simple-table-core 0.8.13 → 0.8.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useState as r,useRef as o,useCallback as i,useEffect as a,useMemo as c,createContext as d,useContext as l,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v}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 g(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function p(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=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function w(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 C=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},I=d(void 0),y=function(n){var t=n.children,r=n.value;return e(I.Provider,m({value:r},{children:t}))},x=function(){var e=l(I);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var o=t.currentPage,i=t.hideFooter,a=t.onPageChange,c=t.onNextPage,d=t.shouldPaginate,l=t.totalPages,s=x(),u=s.nextIcon,h=s.prevIcon,f=r(!0),v=f[0],w=f[1],C=!(o>1),I=!(o<l)&&!c||!v&&o===l;if(i||!d)return null;var y=function(){if(l<=15)return Array.from({length:l},(function(e,n){return n+1}));var e,n,t=[],r=15;if(o<=Math.ceil(7.5))e=1,n=14;else if(o>=l-Math.floor(7.5))e=Math.max(1,l-r+1),n=l;else{var i=Math.floor(7);e=o-i,n=o+(r-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<l-1&&(t.push(-1),t.push(l)),t}();return n("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){var e=o-1;e>=1&&a(e)},disabled:C},{children:h})),e("button",m({className:"st-next-prev-btn ".concat(I?"disabled":""),onClick:function(){return g(void 0,void 0,void 0,(function(){var e,n;return p(this,(function(t){switch(t.label){case 0:return e=o===l,n=o+1,c&&e?[4,c(o)]:[3,2];case 1:if(!t.sent())return w(!1),[2];t.label=2;case 2:return(n<=l||c)&&a(n),[2]}}))}))},disabled:I},{children:u})),y.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<=l&&a(e)}(n)},className:"st-page-btn ".concat(o===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},R=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"})}))},M=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"})}))},E=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:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},S=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:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},k=function(e){return e.position*(e.rowHeight+1)-1},D=function(e){return e.position*(e.rowHeight+1)},W=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},N=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},H=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},L=function(n){var t=n.children,i=n.onClose,c=n.open,d=n.setOpen,l=n.width,s=n.containerRef,u=x(),h=null==u?void 0:u.mainBodyRef,f=o(null),v=o(null),g=r("bottom-left"),p=g[0],w=g[1],C=r({}),I=C[0],y=C[1],b=r(!1),R=b[0],M=b[1];return a((function(){c&&f.current?(M(!1),!v.current&&f.current.parentElement&&(v.current=f.current.parentElement),requestAnimationFrame((function(){if(f.current&&v.current){var e,n=f.current,t=v.current.getBoundingClientRect(),r=n.offsetHeight,o=l||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==h?void 0:h.current)?h.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,c="bottom",d={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var u="left";o>e.right-t.right+t.width&&(u="right"),"bottom"===c?d.top=t.bottom+4:d.bottom=window.innerHeight-t.top+4,"left"===u?d.left=t.left:d.right=window.innerWidth-t.right,w("".concat(c,"-").concat(u)),y(d),M(!0)}}))):c||M(!1)}),[c,l,s,h]),a((function(){var e=function(e){if(c&&f.current){var n=e.target;f.current&&!f.current.contains(n)&&(d(!1),null==i||i())}};return c&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[c,i,d]),a((function(){var e=function(e){f.current&&!f.current.contains(e.target)&&(d(!1),null==i||i())};return c&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,c,d]),a((function(){var e=function(e){"Escape"===e.key&&c&&(d(!1),null==i||i())};return c&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,c,d]),c?e("div",m({ref:f,className:"st-dropdown-content st-dropdown-".concat(p),style:m({width:l?"".concat(l,"px"):"auto",visibility:R?"visible":"hidden"},I)},{children:t})):null},T=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,c=void 0!==a&&a,d=n.className,l=void 0===d?"":d;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(c?"disabled":""," ").concat(l),onClick:function(){!c&&r&&r()},role:"option","aria-selected":i,"aria-disabled":c},{children:t}))},B=function(t){var o=t.onBlur,i=t.onChange,c=t.open,d=t.setOpen,l=t.value,s=r(l),u=s[0],h=s[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var f=function(e){h(e),i(e),d(!1),o()};return n(L,m({open:c,onClose:function(){o()},setOpen:d,width:120},{children:[e(T,m({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(T,m({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},O=function(n){var t=n.defaultValue,r=n.onBlur,i=n.onChange,a=o(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;i(n)}})},P=function(n){var t=n.defaultValue,r=n.onBlur,i=n.onChange,a=o(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)&&i(n)}})},F=function(o){var i,a,c=o.value,d=o.onChange,l=o.onClose,s=x(),u=s.nextIcon,h=s.prevIcon,f=r(c||new Date),v=f[0],g=f[1],p=r("days"),w=p[0],C=p[1],I=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",m({className:"st-datepicker"},{children:[n("div",m({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",m({onClick:function(){g(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",m({className:"st-datepicker-header-label",onClick:function(){return C("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){g(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return C("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=I(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=I(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 s=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);g(n),d(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(c).getDate()&&r===new Date(c).getMonth()&&t===new Date(c).getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);g(n),d(n),null==l||l()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var p=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);g(n),d(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=p;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){g(new Date(v.getFullYear(),e,1)),C("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){g(new Date(e,v.getMonth(),1)),C("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;g(e),d(e),null==l||l()}},{children:"Today"}))}))]}))},A=function(n){var t=n.onBlur,o=n.onChange,i=n.open,c=n.setOpen,d=n.value,l=r(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),s=l[0],u=l[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){t()};return e(L,m({open:i,onClose:h,setOpen:c,width:280},{children:e(F,{value:s,onChange:function(e){u(e),o(e.toISOString()),c(!1),t()},onClose:h})}))},U=function(n){var t=n.onBlur,o=n.onChange,i=n.open,c=n.options,d=n.setOpen,l=n.value,s=r(l||""),u=s[0],h=s[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e(L,m({open:i,onClose:function(){t()},setOpen:d,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e(T,m({isSelected:u===n,onClick:function(){return h(e=n),o(e),d(!1),void t();var e}},{children:n}),n)}))}))}))},z=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,l=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e(B,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c)return e(A,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:"string"==typeof d?d:""});if("enum"===c)return e(U,{onBlur:l,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:"string"==typeof d?d:""});if("number"===c&&"number"==typeof d)return e(P,{defaultValue:d,onBlur:l,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==d?"":String(d);return e(O,{defaultValue:s,onBlur:l,onChange:function(e){return o(e)}})},j=0,Y=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===j||o-j>=r)&&(j=o,n(t))}},J=Date.now(),q={screenX:0,screenY:0},V=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 w(w([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=V(o.children,n,w(w([],t,!0),[r],!1));if(i)return i}}return null};var K=function(e){var n,t,r=e.draggedHeaderRef,i=e.headersRef,c=e.hoveredHeaderRef,d=e.onColumnOrderChange,l=e.onTableHeaderDragEnd,s=(n=i.current,t=o(n),a((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,J=Date.now()},handleDragOver:function(e){var n,t,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var d=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-q.screenX,2)+Math.pow(h-q.screenY,2));c.current=a;var v=i.current,m=V(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),g=V(v,a.accessor);if(m&&g){var p=m.length,w=g.length,C=g;if(p!==w){var I=w-p;I>0&&(C=g.slice(0,-I))}var y=function(e,n,t){var r=JSON.parse(JSON.stringify(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 c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,C),x=y.newHeaders,b=y.emergencyBreak;if(!(d||a.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===m.length||0===C.length||JSON.stringify(x)===JSON.stringify(i.current)||b)){var R=Date.now();JSON.stringify(x)===JSON.stringify(s)&&(R-J<1500||f<40)||(J=R,q={screenX:u,screenY:h},l(x))}}}},handleDragEnd:function(){r.current=null,c.current=null,null==d||d(i.current)}}},X=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},G=s((function(t,c){var d,l,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,g=t.onExpandRowClick,p=t.rowIndex,w=t.visibleRow,C=x(),I=C.cellRegistry,y=C.cellUpdateFlash,b=C.collapseIcon,R=C.draggedHeaderRef,M=C.expandIcon,E=C.handleMouseDown,S=C.handleMouseOver,k=C.headersRef,D=C.hoveredHeaderRef,N=C.onCellEdit,L=C.onTableHeaderDragEnd,T=w.depth,B=w.row,O=r(B.rowData[h.accessor]),P=O[0],F=O[1],A=r(!1),U=A[0],j=A[1],J=r(!1),q=J[0],V=J[1],G=o(null),$=K({draggedHeaderRef:R,headersRef:k,hoveredHeaderRef:D,onTableHeaderDragEnd:L}).handleDragOver,_=Y(),Q="cell-".concat(p,"-").concat(u),Z=H({rowId:B.rowMeta.rowId,accessor:h.accessor});a((function(){if(I){var e="".concat(B.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){P!==e?(F(e),y&&(V(!0),G.current&&clearTimeout(G.current),G.current=setTimeout((function(){V(!1)}),800))):F(e)}}),function(){I.delete(e),G.current&&clearTimeout(G.current)}}}),[I,y,B.rowMeta.rowId,h.accessor,P]),a((function(){if(q){var e=setTimeout((function(){V(!1)}),850);return function(){return clearTimeout(e)}}}),[q]),a((function(){F(B.rowData[h.accessor])}),[B.rowData,h.accessor]),a((function(){f||j(!1)}),[f]);var ee="boolean"===h.type||"date"===h.type||"enum"===h.type,ne=Boolean(null===(l=null===(d=B.rowMeta)||void 0===d?void 0:d.children)||void 0===l?void 0:l.length),te=Boolean(null==h?void 0:h.isEditable),re="st-cell ".concat(T>0&&h.expandable?"st-cell-depth-".concat(T):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(te?"clickable":""," ").concat(q?"st-cell-updating":""),oe=i((function(e){F(e),null==N||N({accessor:h.accessor,newValue:e,row:B})}),[h.accessor,N,B]);return U&&!ee?e("div",m({className:"st-cell-editing",id:W({accessor:h.accessor,rowIndex:p+1})},{children:e(z,{enumOptions:h.enumOptions,onChange:oe,setIsEditing:j,type:h.type,value:P})})):n("div",m({className:re,id:Q,onDoubleClick:function(){return h.isEditable&&j(!0)},onMouseDown:function(){return E({rowIndex:p,colIndex:u,rowId:B.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:p,colIndex:u,rowId:B.rowMeta.rowId})},onDragOver:function(e){return _({callback:$,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||U||(e.preventDefault(),j(!0))},ref:c,"data-row-index":p,"data-col-index":u,"data-row-id":B.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&ne?B.rowMeta.isExpanded?e("div",m({className:"st-sort-icon-container",onClick:function(){return g(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):e("div",m({className:"st-sort-icon-container",onClick:function(){return g(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:M})):null,e("span",m({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"")},{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:B}):X({content:P,header:h})})),U&&ee&&e(z,{enumOptions:h.enumOptions,onChange:oe,setIsEditing:j,type:h.type,value:P})]}),Z)})),$=function(n){var r=n.children,o=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"]);return x().allowAnimations?e(_,m({},o,{children:r})):e(t,{children:r})},_=function(n){var i=n.children,c=n.isBody,d=n.pauseAnimation,l=n.rowIndex,s=o(!1),h=x(),f=h.draggedHeaderRef,v=h.headersRef,m=h.mainBodyRef,g=h.shouldPaginate,p=r({}),w=p[0],C=p[1],I=o({}),y=v.current;return u((function(){if(y){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(W({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:y,draggedHeaderRef:f,rowIndex:l});JSON.stringify(e)!==JSON.stringify(w)&&(I.current=w,C(e))}}),[w,y,f,c,l]),u((function(){var e=m.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[f,m]),a((function(){d||s.current||Object.keys(I.current).length&&y&&y.forEach((function(e){var n=document.getElementById(W({accessor:e.accessor,rowIndex:l}));if(n){var t=I.current[e.accessor],r=w[e.accessor];if(t&&r){var o=t.left-r.left,i=g?0:t.top-r.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[w,y,c,d,I,l,g]),e(t,{children:i})},Q=function(n){var t=n.columnIndices,r=n.headers,o=n.hiddenColumns,i=n.isWidthDragging,a=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,l=n.rowIndices,s=n.visibleRow,u=r.filter((function(e){return N({hiddenColumns:o,header:e,pinned:c})}));return e($,m({isBody:!0,pauseAnimation:i,rowIndex:d+1},{children:u.map((function(n){return e(Z,{columnIndices:t,header:n,headers:r,hiddenColumns:o,onExpandRowClick:a,pinned:c,rowIndex:d,rowIndices:l,visibleRow:s},W({accessor:n.accessor,rowIndex:d+1}))}))}))},Z=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,l=n.rowIndices,s=n.visibleRow,u=t[r.accessor],f=x(),v=f.getBorderClass,m=f.isSelected,g=f.isInitialFocusedCell;if(r.children){var p=r.children.filter((function(e){return N({hiddenColumns:i,header:e,pinned:c})}));return e(h,{children:p.map((function(n){return e(Z,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:c,rowIndex:d,rowIndices:l,visibleRow:s},W({accessor:n.accessor,rowIndex:d+1}))}))})}var w={rowIndex:d,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(w),I=m(w),y=g(w);return e(G,{borderClass:C,colIndex:u,header:r,isHighlighted:I,isInitialFocused:y,onExpandRowClick:a,rowIndex:d,visibleRow:s},W({accessor:r.accessor,rowIndex:d+1}))},ee=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.headers,i=n.hiddenColumns,a=n.index,c=n.isWidthDragging,d=n.onExpandRowClick,l=n.pinned,s=n.rowHeight,u=n.rowIndices,h=n.visibleRow,f=h.position;return e("div",m({className:"st-row ".concat(f%2==0?"even":"odd"),style:{gridTemplateColumns:r,top:D({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:e(Q,{columnIndices:t,headers:o,hiddenColumns:i,isWidthDragging:c,onExpandRowClick:d,pinned:l,rowIndex:a,rowIndices:u,visibleRow:h},a)}))},ne=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:k({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},te=function(t){var r=t.columnIndices,o=t.headers,i=t.hiddenColumns,a=t.isWidthDragging,c=t.onExpandRowClick,d=t.pinned,l=t.ref,s=t.rowHeight,u=t.rowIndices,f=t.templateColumns,v=t.totalHeight,g=t.visibleRows,p=t.width,w=d?"st-body-pinned-".concat(d):"st-body-main";return e("div",m({className:w,ref:l,style:m({position:"relative",height:"".concat(v,"px"),width:p},!d&&{flexGrow:1})},{children:g.map((function(t,l){var v,m,p=g[l-1],w=Boolean((null==p?void 0:p.depth)!==(null==t?void 0:t.depth)&&(null===(m=null===(v=null==t?void 0:t.row.rowMeta)||void 0===v?void 0:v.children)||void 0===m?void 0:m.length)&&0===t.depth);return n(h,{children:[0!==l&&e(ne,{displayStrongBorder:w,position:t.position,rowHeight:s,templateColumns:f}),e(ee,{columnIndices:r,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:l,isWidthDragging:a,onExpandRowClick:c,pinned:d,rowHeight:s,rowIndices:u,visibleRow:t})]},t.position)}))}))};function re(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=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 N({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&N({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var oe=function(t){var i=t.flattenedRows,d=t.headerContainerRef,l=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,g=t.pinnedRightTemplateColumns,p=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,I=t.visibleRows,y=x(),b=y.headersRef,R=y.hiddenColumns,M=y.mainBodyRef,E=y.rowHeight,S=y.scrollbarWidth,k=y.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=r(!1),c=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(c&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,c,o]),a((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;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:d,mainSectionRef:k,scrollbarWidth:S});var D,W,N=o(null),H=(D=0,(W=function(e){e.forEach((function(e){D+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&W(e.rowMeta.children)}))})(i),D)*(E+1)-1,L=c((function(){return re({headersRef:b,hiddenColumns:R,pinnedLeftColumns:u,pinnedRightColumns:v})}),[b,R,u,v]),T=c((function(){var e={};return I.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[I]),B=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?m(m({},t),{rowMeta:m(m({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?m(m({},t),{rowMeta:m(m({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},O={headerContainerRef:d,headers:b.current,hiddenColumns:R,isWidthDragging:l,rowHeight:E,visibleRows:I,columnIndices:L,rowIndices:T};return n("div",m({className:"st-body-container",ref:k,onScroll:function(e){var n=e.currentTarget.scrollTop;N.current&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame((function(){C(n)}))}},{children:[u.length>0&&e(te,m({},O,{onExpandRowClick:B,pinned:"left",templateColumns:h,totalHeight:H,width:f})),e(te,m({},O,{ref:M,onExpandRowClick:B,templateColumns:s,totalHeight:H})),v.length>0&&e(te,m({},O,{onExpandRowClick:B,pinned:"right",templateColumns:g,totalHeight:H,width:p}))]}))},ie=function(e,n){a((function(){if(e.current){var t=e.current,r=function(){var e,r=null==t?void 0:t.scrollLeft;void 0!==r&&(null===(e=n.current)||void 0===e||e.scrollTo(r,0))};return t.addEventListener("scroll",r),function(){null==t||t.removeEventListener("scroll",r)}}}),[e,n])},ae=function(e){return void 0===e&&(e=0),e?e+1:0},ce=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return ce(e)})):[e]},de=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(W({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},le=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(W({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){le(e)}))},se=function(e){return"number"==typeof e.minWidth?e.minWidth:40},ue=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:ce(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=de(e))})))})),n.pinned?ae(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},he=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,l=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;c(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=se(i),v=r-o>1,m=v?ce(i):[i],g=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&m.length>1)fe({delta:n,header:i,headersRef:a,leafHeaders:m,minWidth:f,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,f);i.width=r,ue({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s})}a.current.forEach((function(e){le(e)})),t()},p=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p),c(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",p)}},fe=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,l=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,se(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(l+n,s);ue({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},ve=s((function(t,r){var o,i,c=t.colIndex,d=t.forceHeadersUpdate,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,g=t.sort,p=x(),C=p.columnReordering,I=p.columnResizing,y=p.draggedHeaderRef,b=p.forceUpdate,R=p.headersRef,M=p.hoveredHeaderRef,E=p.onColumnOrderChange,S=p.onSort,k=p.onTableHeaderDragEnd,D=p.rowHeight,N=p.selectColumns,H=p.selectableColumns,L=p.setInitialFocusedCell,T=p.setIsWidthDragging,B=p.setMainBodyWidth,O=p.setPinnedLeftWidth,P=p.setPinnedRightWidth,F=p.setSelectedCells,A=p.setSelectedColumns,U=p.sortDownIcon,z=p.sortUpIcon,j=Boolean(null==f?void 0:f.isSortable),J="st-header-cell ".concat(f.accessor===(null===(o=M.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=y.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(j?"clickable":""," ").concat(C&&!j?"columnReordering":""," ").concat("right"===(null==f?void 0:f.align)?"right-aligned":"center"===(null==f?void 0:f.align)?"center-aligned":""," ").concat(f.children?"parent":""),q=K({draggedHeaderRef:y,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:E,onTableHeaderDragEnd:k}),V=q.handleDragStart,X=q.handleDragEnd,G=q.handleDragOver,$=Y(),_=function(e){var n=e.event,t=e.header;if(H){var r=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 c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,c);return n.shiftKey&&N?A((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,c,d,l,s=w(w([],(a=o,c=n,d=Math.min(a,c),l=Math.max(a,c),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(w(w([],Array.from(e),!0),s,!0))})):N&&N(r),F(new Set),void L(null)}t.isSortable&&S(c,t.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var Q=I&&e("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;$({callback:he,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:T,setMainBodyWidth:B,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=g&&g.key.accessor===f.accessor&&n("div",m({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:f})}},{children:["ascending"===g.direction&&z&&z,"descending"===g.direction&&U&&U]}));return n("div",m({className:J,id:W({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){$({callback:G,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:m(m({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-h>1?{}:{height:D})},{children:[v&&Q,"right"===f.align&&Z,e("div",m({className:"st-header-label ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":""),draggable:C&&!f.disableReorder,onClick:function(e){return _({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),X(),d()},onDragStart:function(e){C&&f&&function(e){V(e)}(f)}},{children:null==f?void 0:f.label})),"right"!==f.align&&Z,!v&&Q]}))})),me=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.handleScroll,i=n.headersRef,a=n.hiddenColumns,d=n.maxDepth,l=n.pinned,s=n.sectionRef,u=n.sort,h=f((function(e){return e+1}),0)[1],g=c((function(){var e=[],n=1,r=function(o,i,c){var s,u;if(void 0===c&&(c=!1),!N({hiddenColumns:a,header:o,pinned:l}))return 0;c||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return N({hiddenColumns:a,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,g=h>0?i+1:d+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:g,colIndex:t[o.accessor]}),o.children){var p=!0;o.children.forEach((function(e){N({hiddenColumns:a,header:e,pinned:l})&&(r(e,i+1,p),p=!1)}))}return v-f},o=i.current.filter((function(e){return N({hiddenColumns:a,header:e,pinned:l})})),c=!0;return o.forEach((function(e){r(e,1,c),c=!1})),e}),[i,a,d,l,t]);return e("div",m({className:"st-header-".concat(l?"pinned-".concat(l):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:r,display:"grid",position:"relative"}},{children:e($,m({rowIndex:0},{children:g.map((function(n){return e(ve,{colIndex:n.colIndex,forceHeadersUpdate:h,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:v(),reverse:"right"===l,sort:u},n.header.accessor)}))}))}))},ge=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(ge)):1},pe=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,d=t.mainTemplateColumns,l=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,g=x(),p=g.mainBodyRef,w=g.pinnedLeftRef,C=g.pinnedRightRef,I=g.setPinnedLeftWidth,y=g.setPinnedRightWidth;ie(p,r);var b=c((function(){return re({headersRef:i,hiddenColumns:a,pinnedLeftColumns:l,pinnedRightColumns:h})}),[i,a,l,h]),R=c((function(){var e=i.current,n=0;return e.forEach((function(e){if(N({hiddenColumns:a,header:e})){var t=ge(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return u((function(){var e,n;I(ae(null===(e=w.current)||void 0===e?void 0:e.clientWidth)),y(ae(null===(n=C.current)||void 0===n?void 0:n.clientWidth))}),[w,C,I,y]),n("div",m({className:"st-header-container",ref:o},{children:[l.length>0&&e(me,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"left",sectionRef:w,sort:v}),e(me,{columnIndices:b,gridTemplateColumns:d,handleScroll:function(e){var n,t,o=null===(n=r.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(t=p.current)||void 0===t||t.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:R,sectionRef:r,sort:v}),h.length>0&&e(me,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"right",sectionRef:C,sort:v})]}))},we=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):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(" "))},Ce=function(t){var r=t.flattenedRows,i=t.isWidthDragging,a=t.pinnedLeftWidth,d=t.pinnedRightWidth,l=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=x(),v=f.editColumns,g=f.headersRef,p=f.hiddenColumns,w=o(null),C=o(null),I=g.current.filter((function(e){return!e.pinned})),y=g.current.filter((function(e){return"left"===e.pinned})),b=g.current.filter((function(e){return"right"===e.pinned})),R=c((function(){return we({headers:y,hiddenColumns:p})}),[y,p]),M=c((function(){return we({headers:I,hiddenColumns:p})}),[I,p]),E=c((function(){return we({headers:b,hiddenColumns:p})}),[b,p]),S={flattenedRows:r,headerContainerRef:w,isWidthDragging:i,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:E,pinnedRightWidth:d,setFlattenedRows:l,setScrollTop:s,visibleRows:h};return n("div",m({className:"st-content",style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e(pe,m({},{centerHeaderRef:C,headerContainerRef:w,headersRef:g,hiddenColumns:p,mainTemplateColumns:M,pinnedLeftColumns:y,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:E,sort:u})),e(oe,m({},S))]}))},Ie=function(i){var c,d,l=i.mainBodyWidth,s=i.mainBodyRef,u=i.pinnedLeftWidth,h=i.pinnedRightWidth,f=i.setMainBodyWidth,v=i.tableBodyContainerRef,g=x().editColumns,p=r(!1),w=p[0],C=p[1],I=o(null),y=v.current&&v.current.scrollHeight>v.current.clientHeight,b=g?28:0,R=(g?h+1:h)+(v.current&&y?v.current.offsetWidth-v.current.clientWidth:0);return ie(s,I),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.scrollWidth;f(e)}}()}),1)}),[s,f]),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.clientWidth;C(l>e)}}()}),1)}),[s,l,f]),w?n("div",m({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(c=I.current)||void 0===c?void 0:c.offsetHeight}}),l>0&&e("div",m({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&s.current&&s.current.scrollTo({left:n,behavior:"auto"})},ref:I,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})})),h>0&&e(t,{children:e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:R,height:null===(d=I.current)||void 0===d?void 0:d.offsetHeight}})}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},ye={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 ye.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?ye.string(e,n,t):"number"==typeof e&&"number"==typeof n?ye.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?ye.boolean(e,n,t):ye.string(String(e),String(n),t)}},xe=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 ye.number(i,a,r)}return"date"===t?ye.date(String(e),String(n),r):"boolean"===t?ye.boolean(Boolean(e),Boolean(n),r):"enum"===t?ye.enum(String(e),String(n),r):ye.string(String(e),String(n),r)},be=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,c=new Map,d="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();d=r,c.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(t=a.get(i))||void 0===t||t.push(e)}}));var l=[];return a.forEach((function(e,r){if(c.has(r)){var a=c.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=Re(a.rowMeta.children,n,t)),l.push(a)}var d=w([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return xe(a,c,o,i)}));l.push.apply(l,d.map((function(e){var r=m({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=Re(r.rowMeta.children,n,t);r.rowMeta=m(m({},r.rowMeta),{children:o})}return r})))})),l},Re=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),o=(null==r?void 0:r.type)||"string",i=n.direction;return w([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return xe(a,c,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?m(m({},e),{rowMeta:m(m({},e.rowMeta),{children:Re(e.rowMeta.children,n,t)})}):e}))},Me=function(e){var n=e.headers,t=e.tableRows,o=r(null),i=o[0],a=o[1],d=c((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),l=r(d),s=l[0],u=l[1],h=c((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:be(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Ee=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("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("span",{className:"st-checkbox-checkmark"})})),i]}))},Se=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var l=0,s=a.children;l<s.length;l++){var u=s[l];if(Se([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},ke=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},De=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(De(e.children,n),ke(e.children,n)&&(n[e.accessor]=!0))}))},We=function(o){var i=o.allHeaders,a=o.depth,c=void 0===a?0:a,d=o.header,l=o.hiddenColumns,s=o.setHiddenColumns,u=r(!0),h=u[0],f=u[1],v=x(),g=v.expandIcon,p=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,y=v.setPinnedRightWidth,b="".concat(16*c,"px"),R=d.children&&d.children.length>0,M=l[d.accessor]||R&&d.children&&ke(d.children,l);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[e("div",m({className:"st-header-icon-container"},{children:R?e("div",m({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?p:g})):null})),e(Ee,m({checked:M,onChange:function(e){var n=m({},l);(n[d.accessor]=e,e)?De(i,n):(Se(i,d.accessor,n),R&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===l[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,Se(i,d.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=ce(e).reduce((function(e,n){return e+de(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=ae(i),l=ae(a);r(d),o(l),t(c)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:y})}},{children:d.label}))]})),R&&h&&d.children&&e("div",m({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e(We,{allHeaders:i,depth:c+1,header:n,hiddenColumns:l,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},Ne=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,c="left"===o?"left":"";return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(We,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},He=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,l=t.position,s=void 0===l?"right":l,u=t.setHiddenColumns,h=r(a),f=h[0],v=h[1];return i?n("div",m({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:o})),e(Ne,{headers:c,open:f,position:s,setHiddenColumns:u,hiddenColumns:d})]})):null},Le=function(n){var t=r(!1),o=t[0],i=t[1];return a((function(){i(!0)}),[]),o?e(Te,m({},n)):null},Te=function(t){var d=t.allowAnimations,l=void 0!==d&&d,s=t.cellUpdateFlash,h=void 0!==s&&s,v=t.collapseIcon,g=void 0===v?e(S,{className:"st-sort-icon"}):v,p=t.columnEditorPosition,w=void 0===p?"right":p,I=t.columnEditorText,x=void 0===I?"Columns":I,k=t.columnReordering,D=void 0!==k&&k,W=t.columnResizing,N=void 0!==W&&W,L=t.defaultHeaders,T=t.editColumns,B=void 0!==T&&T,O=t.editColumnsInitOpen,P=void 0!==O&&O,F=t.expandIcon,A=void 0===F?e(M,{className:"st-sort-icon"}):F,U=t.height,z=t.hideFooter,j=void 0!==z&&z,Y=t.nextIcon,J=void 0===Y?e(M,{className:"st-next-prev-icon"}):Y,q=t.onCellEdit,V=t.onColumnOrderChange,K=t.onGridReady,X=t.onNextPage,G=t.prevIcon,$=void 0===G?e(R,{className:"st-next-prev-icon"}):G,_=t.rowHeight,Q=void 0===_?40:_,Z=t.rows,ee=t.rowsPerPage,ne=void 0===ee?10:ee,te=t.selectableCells,re=void 0!==te&&te,oe=t.selectableColumns,ie=void 0!==oe&&oe,ae=t.shouldPaginate,ce=void 0!==ae&&ae,de=t.sortDownIcon,le=void 0===de?e(S,{className:"st-sort-icon"}):de,se=t.sortUpIcon,ue=void 0===se?e(E,{className:"st-sort-icon"}):se,he=t.tableRef,fe=t.theme,ve=void 0===fe?"light":fe,me=o(null),ge=o(L),pe=o(null),we=o(null),ye=o(null),xe=o(null),be=o(null),Re=r(1),Ee=Re[0],Se=Re[1],ke=r(!1),De=ke[0],We=ke[1],Ne=r(0),Le=Ne[0],Te=Ne[1],Be=r(0),Oe=Be[0],Pe=Be[1],Fe=r(0),Ae=Fe[0],Ue=Fe[1],ze=r(0),je=ze[0],Ye=ze[1],Je=r(0),qe=Je[0],Ve=Je[1],Ke=Me({headers:ge.current,tableRows:Z}),Xe=Ke.sort,Ge=Ke.sortedRows,$e=Ke.hiddenColumns,_e=Ke.setHiddenColumns,Qe=Ke.updateSort;a((function(){null==K||K()}),[K]);var Ze=c((function(){if(!ce)return Ge;var e=(Ee-1)*ne,n=e+ne;return Ge.slice(e,n)}),[Ee,ne,ce,Ge]),en=r(Ze),nn=en[0],tn=en[1];a((function(){tn(Ze)}),[Ze]);var rn=c((function(){var e;if(!U)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),t=0;if(U.endsWith("px"))t=parseInt(U,10);else if(U.endsWith("vh")){var r=parseInt(U,10);t=window.innerHeight*r/100}else if(U.endsWith("%")){var o=parseInt(U,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-Q)}),[U,Q]),on=c((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,l=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=s)break;h+a>l&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:rn,flattenedRows:nn,rowHeight:Q,scrollTop:je})}),[rn,Q,nn,je]),an=f((function(e){return e+1}),0)[1],cn=function(e){var n=e.selectableCells,t=e.headers,d=e.visibleRows,l=r(new Set),s=l[0],u=l[1],h=r(new Set),f=h[0],v=h[1],m=r(null),g=m[0],p=m[1],w=r(null),I=w[0],y=w[1],x=o(!1),b=o(null),R=i((function(){var e=Array.from(s).reduce((function(e,n){var r=n.split("-").map(Number),o=r[0],i=r[1];return e[o]||(e[o]=[]),e[o][i]=d[o].row.rowData[t[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[t,s,d]),M=i((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),c=r;c<=o;c++)for(var l=i;l<=a;l++)if(c>=0&&c<d.length){var s=d[c].row.rowMeta.rowId;t.add(C({colIndex:l,rowIndex:c,rowId:s}))}v(new Set),p(null),u(t)}),[d,v,p,u]),E=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<t.length){var n=C(e);v(new Set),p(null),u(new Set([n])),y(e)}}),[t.length,d.length,v,p,u,y]),S=i((function(e,n){void 0===n&&(n=!1),u(new Set),y(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&p(e[e.length-1])}),[u,y,v,p]);a((function(){var e=function(e){if(n&&I){var r=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[r].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;r=a}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c={rowIndex:r-1,colIndex:o,rowId:d[r-1].row.rowMeta.rowId};E(c)}}else"ArrowDown"===e.key?(e.preventDefault(),r<d.length-1&&(c={rowIndex:r+1,colIndex:o,rowId:d[r+1].row.rowMeta.rowId},E(c))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(c={rowIndex:r,colIndex:o-1,rowId:d[r].row.rowMeta.rowId},E(c))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<t.length-1&&(c={rowIndex:r,colIndex:o+1,rowId:d[r].row.rowMeta.rowId},E(c))):"Escape"===e.key&&(u(new Set),v(new Set),p(null),b.current=null,y(null))}else R()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[R,t.length,I,M,E,n,d]);var k=i((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=C({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=i((function(e){var n,t,r,o,i,a,c=e.colIndex,l=e.rowIndex,s=e.rowId,u=[],h=null===(r=null===(t=null===(n=d[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:c,rowIndex:l+1,rowId:null===(a=null===(i=null===(o=d[l+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},m={colIndex:c-1,rowIndex:l,rowId:s},g={colIndex:c+1,rowIndex:l,rowId:s};return(!k({colIndex:c,rowIndex:l-1,rowId:h})||f.has(c)&&0===l)&&u.push("st-selected-top-border"),(!k(v)||f.has(c)&&l===d.length-1)&&u.push("st-selected-bottom-border"),k(m)||u.push("st-selected-left-border"),k(g)||u.push("st-selected-right-border"),u.join(" ")}),[k,d,f]),W=c((function(){return I?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===I.rowIndex&&t===I.colIndex&&r===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:D,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){x.current=!0,b.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),p(null);var i=C({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),y({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,r=e.rowIndex;if(e.rowId,n&&x.current&&b.current){for(var o=new Set,i=Math.min(b.current.rowIndex,r),a=Math.max(b.current.rowIndex,r),c=Math.min(b.current.colIndex,t),l=Math.max(b.current.colIndex,t),s=i;s<=a;s++)for(var h=c;h<=l;h++)if(s>=0&&s<d.length){var f=d[s].row.rowMeta.rowId;o.add(C({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:W,isSelected:k,lastSelectedColumnIndex:g,selectColumns:S,selectedCells:s,selectedColumns:f,setInitialFocusedCell:y,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:re,headers:ge.current,visibleRows:on}),dn=cn.getBorderClass,ln=cn.handleMouseDown,sn=cn.handleMouseOver,un=cn.handleMouseUp,hn=cn.isInitialFocusedCell,fn=cn.isSelected,vn=cn.selectColumns,mn=cn.selectedCells,gn=cn.selectedColumns,pn=cn.setInitialFocusedCell,wn=cn.setSelectedCells,Cn=cn.setSelectedColumns,In=i((function(e,n){Qe(e,n)}),[Qe]),yn=i((function(e){ge.current=e,an()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(mn.size>0&&wn(new Set),gn.size>0&&Cn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,mn,gn,wn,Cn]),u((function(){if(be.current){var e=be.current.offsetWidth-be.current.clientWidth;Ve(e)}}),[]),u((function(){var e=function(){if(an(),be.current){var e=be.current.offsetWidth-be.current.clientWidth;Ve(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var xn=o(new Map);return a((function(){he&&(he.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var l=H({rowId:d,accessor:i}),s=xn.current.get(l);s&&s.updateContent(c),void 0!==(null===(o=null===(r=null==Z?void 0:Z[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=c)}}})}),[he,Z]),e(y,m({value:{allowAnimations:l,cellRegistry:xn.current,cellUpdateFlash:h,collapseIcon:g,columnReordering:D,columnResizing:N,draggedHeaderRef:me,editColumns:B,expandIcon:A,forceUpdate:an,getBorderClass:dn,handleMouseDown:ln,handleMouseOver:sn,headersRef:ge,hiddenColumns:$e,hoveredHeaderRef:pe,isInitialFocusedCell:hn,isSelected:fn,mainBodyRef:we,nextIcon:J,onCellEdit:q,onColumnOrderChange:V,onSort:In,onTableHeaderDragEnd:yn,pinnedLeftRef:ye,pinnedRightRef:xe,prevIcon:$,rowHeight:Q,scrollbarWidth:qe,selectColumns:vn,selectableColumns:ie,setInitialFocusedCell:pn,setIsWidthDragging:We,setMainBodyWidth:Te,setPinnedLeftWidth:Pe,setPinnedRightWidth:Ue,setSelectedCells:wn,setSelectedColumns:Cn,shouldPaginate:ce,sortDownIcon:le,sortUpIcon:ue,tableBodyContainerRef:be}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(ve),style:U?{height:U}:{}},{children:n("div",m({className:"st-wrapper-container"},{children:[n("div",m({className:"st-content-wrapper",onMouseUp:un,onMouseLeave:un},{children:[e(Ce,{flattenedRows:nn,isWidthDragging:De,pinnedLeftWidth:Oe,pinnedRightWidth:Ae,setFlattenedRows:tn,setScrollTop:Ye,sort:Xe,visibleRows:on}),e(He,{columnEditorText:x,editColumns:B,editColumnsInitOpen:P,headers:ge.current,hiddenColumns:$e,position:w,setHiddenColumns:_e})]})),e(Ie,{mainBodyRef:we,mainBodyWidth:Le,pinnedLeftWidth:Oe,pinnedRightWidth:Ae,setMainBodyWidth:Te,tableBodyContainerRef:be}),e(b,{currentPage:Ee,hideFooter:j,onPageChange:Se,onNextPage:X,shouldPaginate:ce,totalPages:Math.ceil(Z.length/ne)})]}))}))}))};export{Le as SimpleTable};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useState as r,useRef as o,useCallback as i,useEffect as a,useMemo as c,createContext as d,useContext as l,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v}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 p(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function c(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}d((r=r.apply(e,n||[])).next())}))}function g(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=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(d){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}function w(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 C=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},I=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},y=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},x=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return x(e)})):[e]},b=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(C({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},R=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(C({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){R(e)}))},M=function(e){return"number"==typeof e.minWidth?e.minWidth:40},E=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},S=d(void 0),k=function(n){var t=n.children,r=n.value;return e(S.Provider,m({value:r},{children:t}))},D=function(){var e=l(S);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},W=function(t){var o=t.currentPage,i=t.hideFooter,a=t.onPageChange,c=t.onNextPage,d=t.shouldPaginate,l=t.totalPages,s=D(),u=s.nextIcon,h=s.prevIcon,f=r(!0),v=f[0],w=f[1],C=!(o>1),I=!(o<l)&&!c||!v&&o===l;if(i||!d)return null;var y=function(){if(l<=15)return Array.from({length:l},(function(e,n){return n+1}));var e,n,t=[],r=15;if(o<=Math.ceil(7.5))e=1,n=14;else if(o>=l-Math.floor(7.5))e=Math.max(1,l-r+1),n=l;else{var i=Math.floor(7);e=o-i,n=o+(r-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<l-1&&(t.push(-1),t.push(l)),t}();return n("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){var e=o-1;e>=1&&a(e)},disabled:C},{children:h})),e("button",m({className:"st-next-prev-btn ".concat(I?"disabled":""),onClick:function(){return p(void 0,void 0,void 0,(function(){var e,n;return g(this,(function(t){switch(t.label){case 0:return e=o===l,n=o+1,c&&e?[4,c(o)]:[3,2];case 1:if(!t.sent())return w(!1),[2];t.label=2;case 2:return(n<=l||c)&&a(n),[2]}}))}))},disabled:I},{children:u})),y.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<=l&&a(e)}(n)},className:"st-page-btn ".concat(o===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},N=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"})}))},H=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"})}))},L=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:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},T=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:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},B=function(e){return e.position*(e.rowHeight+1)-1},O=function(e){return e.position*(e.rowHeight+1)},P=function(n){var t=n.children,i=n.onClose,c=n.open,d=n.setOpen,l=n.width,s=n.containerRef,u=D(),h=null==u?void 0:u.mainBodyRef,f=o(null),v=o(null),p=r("bottom-left"),g=p[0],w=p[1],C=r({}),I=C[0],y=C[1],x=r(!1),b=x[0],R=x[1];return a((function(){c&&f.current?(R(!1),!v.current&&f.current.parentElement&&(v.current=f.current.parentElement),requestAnimationFrame((function(){if(f.current&&v.current){var e,n=f.current,t=v.current.getBoundingClientRect(),r=n.offsetHeight,o=l||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.current.getBoundingClientRect():(null==h?void 0:h.current)?h.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,c="bottom",d={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var u="left";o>e.right-t.right+t.width&&(u="right"),"bottom"===c?d.top=t.bottom+4:d.bottom=window.innerHeight-t.top+4,"left"===u?d.left=t.left:d.right=window.innerWidth-t.right,w("".concat(c,"-").concat(u)),y(d),R(!0)}}))):c||R(!1)}),[c,l,s,h]),a((function(){var e=function(e){if(c&&f.current){var n=e.target;f.current&&!f.current.contains(n)&&(d(!1),null==i||i())}};return c&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[c,i,d]),a((function(){var e=function(e){f.current&&!f.current.contains(e.target)&&(d(!1),null==i||i())};return c&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,c,d]),a((function(){var e=function(e){"Escape"===e.key&&c&&(d(!1),null==i||i())};return c&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,c,d]),c?e("div",m({ref:f,className:"st-dropdown-content st-dropdown-".concat(g),style:m({width:l?"".concat(l,"px"):"auto",visibility:b?"visible":"hidden"},I)},{children:t})):null},F=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,c=void 0!==a&&a,d=n.className,l=void 0===d?"":d;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(c?"disabled":""," ").concat(l),onClick:function(){!c&&r&&r()},role:"option","aria-selected":i,"aria-disabled":c},{children:t}))},A=function(t){var o=t.onBlur,i=t.onChange,c=t.open,d=t.setOpen,l=t.value,s=r(l),u=s[0],h=s[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var f=function(e){h(e),i(e),d(!1),o()};return n(P,m({open:c,onClose:function(){o()},setOpen:d,width:120},{children:[e(F,m({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(F,m({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},z=function(n){var t=n.defaultValue,r=n.onBlur,i=n.onChange,a=o(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;i(n)}})},U=function(n){var t=n.defaultValue,r=n.onBlur,i=n.onChange,a=o(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)&&i(n)}})},j=function(o){var i,a,c=o.value,d=o.onChange,l=o.onClose,s=D(),u=s.nextIcon,h=s.prevIcon,f=r(c||new Date),v=f[0],p=f[1],g=r("days"),w=g[0],C=g[1],I=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",m({className:"st-datepicker"},{children:[n("div",m({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",m({className:"st-datepicker-header-label",onClick:function(){return C("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:u}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return C("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=I(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=I(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 s=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);p(n),d(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(c).getDate()&&r===new Date(c).getMonth()&&t===new Date(c).getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);p(n),d(n),null==l||l()}(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);p(n),d(n),null==l||l()}(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)),C("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)),C("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;p(e),d(e),null==l||l()}},{children:"Today"}))}))]}))},Y=function(n){var t=n.onBlur,o=n.onChange,i=n.open,c=n.setOpen,d=n.value,l=r(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(d)),s=l[0],u=l[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){t()};return e(P,m({open:i,onClose:h,setOpen:c,width:280},{children:e(j,{value:s,onChange:function(e){u(e),o(e.toISOString()),c(!1),t()},onClose:h})}))},q=function(n){var t=n.onBlur,o=n.onChange,i=n.open,c=n.options,d=n.setOpen,l=n.value,s=r(l||""),u=s[0],h=s[1];a((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e(P,m({open:i,onClose:function(){t()},setOpen:d,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e(F,m({isSelected:u===n,onClick:function(){return h(e=n),o(e),d(!1),void t();var e}},{children:n}),n)}))}))}))},J=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,d=n.value,l=function(){i(!1)};if("boolean"===c&&"boolean"==typeof d)return e(A,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:d});if("date"===c)return e(Y,{onBlur:l,onChange:function(e){return o(e)},open:!0,setOpen:i,value:"string"==typeof d?d:""});if("enum"===c)return e(q,{onBlur:l,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:"string"==typeof d?d:""});if("number"===c&&"number"==typeof d)return e(U,{defaultValue:d,onBlur:l,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==d?"":String(d);return e(z,{defaultValue:s,onBlur:l,onChange:function(e){return o(e)}})},V=0,K=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===V||o-V>=r)&&(V=o,n(t))}},X=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(X);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=X(e[t]));return n},G=Date.now(),$={screenX:0,screenY:0},_=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 w(w([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=_(o.children,n,w(w([],t,!0),[r],!1));if(i)return i}}return null};var Q=function(e){var n,t,r=e.draggedHeaderRef,i=e.headersRef,c=e.hoveredHeaderRef,d=e.onColumnOrderChange,l=e.onTableHeaderDragEnd,s=(n=i.current,t=o(n),a((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,G=Date.now()},handleDragOver:function(e){var n,t,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var d=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-$.screenX,2)+Math.pow(h-$.screenY,2));c.current=a;var v=i.current,m=_(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),p=_(v,a.accessor);if(m&&p){var g=m.length,w=p.length,C=p;if(g!==w){var I=w-g;I>0&&(C=p.slice(0,-I))}var y=function(e,n,t){var r=X(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 c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,C),x=y.newHeaders,b=y.emergencyBreak;if(!(d||a.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===m.length||0===C.length||JSON.stringify(x)===JSON.stringify(i.current)||b)){var R=Date.now();JSON.stringify(x)===JSON.stringify(s)&&(R-G<1500||f<40)||(G=R,$={screenX:u,screenY:h},l(x))}}}},handleDragEnd:function(){r.current=null,c.current=null,null==d||d(i.current)}}},Z=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ee=s((function(t,c){var d,l,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,p=t.onExpandRowClick,g=t.rowIndex,w=t.visibleRow,I=D(),x=I.cellRegistry,b=I.cellUpdateFlash,R=I.collapseIcon,M=I.draggedHeaderRef,E=I.expandIcon,S=I.handleMouseDown,k=I.handleMouseOver,W=I.headersRef,N=I.hoveredHeaderRef,H=I.onCellEdit,L=I.onTableHeaderDragEnd,T=w.depth,B=w.row,O=r(B.rowData[h.accessor]),P=O[0],F=O[1],A=r(!1),z=A[0],U=A[1],j=r(!1),Y=j[0],q=j[1],V=o(null),X=Q({draggedHeaderRef:M,headersRef:W,hoveredHeaderRef:N,onTableHeaderDragEnd:L}).handleDragOver,G=K(),$="cell-".concat(g,"-").concat(u),_=y({rowId:B.rowMeta.rowId,accessor:h.accessor});a((function(){if(x){var e="".concat(B.rowMeta.rowId,"-").concat(h.accessor);return x.set(e,{updateContent:function(e){P!==e?(F(e),b&&(q(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){q(!1)}),800))):F(e)}}),function(){x.delete(e),V.current&&clearTimeout(V.current)}}}),[x,b,B.rowMeta.rowId,h.accessor,P]),a((function(){if(Y){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[Y]),a((function(){F(B.rowData[h.accessor])}),[B.rowData,h.accessor]),a((function(){f||U(!1)}),[f]);var ee="boolean"===h.type||"date"===h.type||"enum"===h.type,ne=Boolean(null===(l=null===(d=B.rowMeta)||void 0===d?void 0:d.children)||void 0===l?void 0:l.length),te=Boolean(null==h?void 0:h.isEditable),re="st-cell ".concat(T>0&&h.expandable?"st-cell-depth-".concat(T):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(te?"clickable":""," ").concat(Y?"st-cell-updating":""),oe=i((function(e){F(e),null==H||H({accessor:h.accessor,newValue:e,row:B})}),[h.accessor,H,B]);return z&&!ee?e("div",m({className:"st-cell-editing",id:C({accessor:h.accessor,rowIndex:g+1})},{children:e(J,{enumOptions:h.enumOptions,onChange:oe,setIsEditing:U,type:h.type,value:P})})):n("div",m({className:re,id:$,onDoubleClick:function(){return h.isEditable&&U(!0)},onMouseDown:function(){return S({rowIndex:g,colIndex:u,rowId:B.rowMeta.rowId})},onMouseOver:function(){return k({rowIndex:g,colIndex:u,rowId:B.rowMeta.rowId})},onDragOver:function(e){return G({callback:X,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||z||(e.preventDefault(),U(!0))},ref:c,"data-row-index":g,"data-col-index":u,"data-row-id":B.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&ne?B.rowMeta.isExpanded?e("div",m({className:"st-sort-icon-container",onClick:function(){return p(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:R})):e("div",m({className:"st-sort-icon-container",onClick:function(){return p(B.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:E})):null,e("span",m({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:e("span",{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:B}):Z({content:P,header:h})})})),z&&ee&&e(J,{enumOptions:h.enumOptions,onChange:oe,setIsEditing:U,type:h.type,value:P})]}),_)})),ne=function(n){var r=n.children,o=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"]);return D().allowAnimations?e(te,m({},o,{children:r})):e(t,{children:r})},te=function(n){var i=n.children,c=n.isBody,d=n.pauseAnimation,l=n.rowIndex,s=o(!1),h=D(),f=h.draggedHeaderRef,v=h.headersRef,m=h.mainBodyRef,p=h.shouldPaginate,g=r({}),w=g[0],I=g[1],y=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(C({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:l});JSON.stringify(e)!==JSON.stringify(w)&&(y.current=w,I(e))}}),[w,x,f,c,l]),u((function(){var e=m.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[f,m]),a((function(){d||s.current||Object.keys(y.current).length&&x&&x.forEach((function(e){var n=document.getElementById(C({accessor:e.accessor,rowIndex:l}));if(n){var t=y.current[e.accessor],r=w[e.accessor];if(t&&r){var o=t.left-r.left,i=p?0:t.top-r.top,a=Math.abs(o),c=Math.abs(i);(a>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[w,x,c,d,y,l,p]),e(t,{children:i})},re=function(n){var t=n.columnIndices,r=n.headers,o=n.hiddenColumns,i=n.isWidthDragging,a=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,l=n.rowIndices,s=n.visibleRow,u=r.filter((function(e){return I({hiddenColumns:o,header:e,pinned:c})}));return e(ne,m({isBody:!0,pauseAnimation:i,rowIndex:d+1},{children:u.map((function(n){return e(oe,{columnIndices:t,header:n,headers:r,hiddenColumns:o,onExpandRowClick:a,pinned:c,rowIndex:d,rowIndices:l,visibleRow:s},C({accessor:n.accessor,rowIndex:d+1}))}))}))},oe=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,l=n.rowIndices,s=n.visibleRow,u=t[r.accessor],f=D(),v=f.getBorderClass,m=f.isSelected,p=f.isInitialFocusedCell;if(r.children){var g=r.children.filter((function(e){return I({hiddenColumns:i,header:e,pinned:c})}));return e(h,{children:g.map((function(n){return e(oe,{columnIndices:t,header:n,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:c,rowIndex:d,rowIndices:l,visibleRow:s},C({accessor:n.accessor,rowIndex:d+1}))}))})}var w={rowIndex:d,colIndex:u,rowId:s.row.rowMeta.rowId},y=v(w),x=m(w),b=p(w);return e(ee,{borderClass:y,colIndex:u,header:r,isHighlighted:x,isInitialFocused:b,onExpandRowClick:a,rowIndex:d,visibleRow:s},C({accessor:r.accessor,rowIndex:d+1}))},ie=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.headers,i=n.hiddenColumns,a=n.index,c=n.isWidthDragging,d=n.onExpandRowClick,l=n.pinned,s=n.rowHeight,u=n.rowIndices,h=n.visibleRow,f=h.position;return e("div",m({className:"st-row ".concat(f%2==0?"even":"odd"),style:{gridTemplateColumns:r,top:O({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:e(re,{columnIndices:t,headers:o,hiddenColumns:i,isWidthDragging:c,onExpandRowClick:d,pinned:l,rowIndex:a,rowIndices:u,visibleRow:h},a)}))},ae=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:B({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},ce=function(t){var r=t.columnIndices,o=t.headers,i=t.hiddenColumns,a=t.isWidthDragging,c=t.onExpandRowClick,d=t.pinned,l=t.ref,s=t.rowHeight,u=t.rowIndices,f=t.templateColumns,v=t.totalHeight,p=t.visibleRows,g=t.width,w=d?"st-body-pinned-".concat(d):"st-body-main";return e("div",m({className:w,ref:l,style:m({position:"relative",height:"".concat(v,"px"),width:g},!d&&{flexGrow:1})},{children:p.map((function(t,l){var v,m,g=p[l-1],w=Boolean((null==g?void 0:g.depth)!==(null==t?void 0:t.depth)&&(null===(m=null===(v=null==t?void 0:t.row.rowMeta)||void 0===v?void 0:v.children)||void 0===m?void 0:m.length)&&0===t.depth);return n(h,{children:[0!==l&&e(ae,{displayStrongBorder:w,position:t.position,rowHeight:s,templateColumns:f}),e(ie,{columnIndices:r,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:l,isWidthDragging:a,onExpandRowClick:c,pinned:d,rowHeight:s,rowIndices:u,visibleRow:t})]},t.position)}))}))};function de(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=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 I({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&I({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var le=function(t){var i=t.flattenedRows,d=t.headerContainerRef,l=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,p=t.pinnedRightTemplateColumns,g=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,I=t.visibleRows,y=D(),x=y.headersRef,b=y.hiddenColumns,R=y.mainBodyRef,M=y.rowHeight,E=y.scrollbarWidth,S=y.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=r(!1),c=i[0],d=i[1];a((function(){var e=null==n?void 0:n.current;if(c&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,c,o]),a((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;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:d,mainSectionRef:S,scrollbarWidth:E});var k,W,N=o(null),H=(k=0,(W=function(e){e.forEach((function(e){k+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&W(e.rowMeta.children)}))})(i),k)*(M+1)-1,L=c((function(){return de({headersRef:x,hiddenColumns:b,pinnedLeftColumns:u,pinnedRightColumns:v})}),[x,b,u,v]),T=c((function(){var e={};return I.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[I]),B=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?m(m({},t),{rowMeta:m(m({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?m(m({},t),{rowMeta:m(m({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},O={headerContainerRef:d,headers:x.current,hiddenColumns:b,isWidthDragging:l,rowHeight:M,visibleRows:I,columnIndices:L,rowIndices:T};return n("div",m({className:"st-body-container",ref:S,onScroll:function(e){var n=e.currentTarget.scrollTop;N.current&&cancelAnimationFrame(N.current),N.current=requestAnimationFrame((function(){C(n)}))}},{children:[u.length>0&&e(ce,m({},O,{onExpandRowClick:B,pinned:"left",templateColumns:h,totalHeight:H,width:f})),e(ce,m({},O,{ref:R,onExpandRowClick:B,templateColumns:s,totalHeight:H})),v.length>0&&e(ce,m({},O,{onExpandRowClick:B,pinned:"right",templateColumns:p,totalHeight:H,width:g}))]}))},se=function(e,n){a((function(){if(e.current){var t=e.current,r=function(){var e,r=null==t?void 0:t.scrollLeft;void 0!==r&&(null===(e=n.current)||void 0===e||e.scrollTo(r,0))};return t.addEventListener("scroll",r),function(){null==t||t.removeEventListener("scroll",r)}}}),[e,n])},ue=function(e){return void 0===e&&(e=0),e?e+1:0},he=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:x(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=b(e))})))})),n.pinned?ue(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},fe=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,d=e.setMainBodyWidth,l=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;c(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=M(i),v=r-o>1,m=v?x(i):[i],p=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&m.length>1)ve({delta:n,header:i,headersRef:a,leafHeaders:m,minWidth:f,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,f);i.width=r,he({header:i,headers:a.current,newWidth:r,setMainBodyWidth:d,setPinnedLeftWidth:l,setPinnedRightWidth:s})}a.current.forEach((function(e){R(e)})),t()},g=function(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g),c(!1)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)}},ve=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,d=e.setPinnedRightWidth,l=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,M(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(l+n,s);he({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:d});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},me=s((function(t,r){var o,i,c=t.colIndex,d=t.forceHeadersUpdate,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,p=t.sort,g=D(),I=g.columnReordering,y=g.columnResizing,x=g.draggedHeaderRef,b=g.forceUpdate,R=g.headersRef,M=g.hoveredHeaderRef,E=g.onColumnOrderChange,S=g.onSort,k=g.onTableHeaderDragEnd,W=g.rowHeight,N=g.selectColumns,H=g.selectableColumns,L=g.setInitialFocusedCell,T=g.setIsWidthDragging,B=g.setMainBodyWidth,O=g.setPinnedLeftWidth,P=g.setPinnedRightWidth,F=g.setSelectedCells,A=g.setSelectedColumns,z=g.sortDownIcon,U=g.sortUpIcon,j=Boolean(null==f?void 0:f.isSortable),Y="st-header-cell ".concat(f.accessor===(null===(o=M.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(j?"clickable":""," ").concat(I&&!j?"columnReordering":""," ").concat(f.children?"parent":""),q=Q({draggedHeaderRef:x,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:E,onTableHeaderDragEnd:k}),J=q.handleDragStart,V=q.handleDragEnd,X=q.handleDragOver,G=K(),$=function(e){var n=e.event,t=e.header;if(H){var r=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 c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,c);return n.shiftKey&&N?A((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,c,d,l,s=w(w([],(a=o,c=n,d=Math.min(a,c),l=Math.max(a,c),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(w(w([],Array.from(e),!0),s,!0))})):N&&N(r),F(new Set),void L(null)}t.isSortable&&S(c,t.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var _=y&&e("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;G({callback:fe,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:T,setMainBodyWidth:B,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=p&&p.key.accessor===f.accessor&&n("div",m({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:f})}},{children:["ascending"===p.direction&&U&&U,"descending"===p.direction&&z&&z]}));return n("div",m({className:Y,id:C({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){G({callback:X,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:m(m({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-h>1?{}:{height:W})},{children:[v&&_,"right"===f.align&&Z,e("div",m({className:"st-header-label",draggable:I&&!f.disableReorder,onClick:function(e){return $({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),V(),d()},onDragStart:function(e){I&&f&&function(e){J(e)}(f)}},{children:e("span",m({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:null==f?void 0:f.label}))})),"right"!==f.align&&Z,!v&&_]}))})),pe=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.handleScroll,i=n.headersRef,a=n.hiddenColumns,d=n.maxDepth,l=n.pinned,s=n.sectionRef,u=n.sort,h=f((function(e){return e+1}),0)[1],p=c((function(){var e=[],n=1,r=function(o,i,c){var s,u;if(void 0===c&&(c=!1),!I({hiddenColumns:a,header:o,pinned:l}))return 0;c||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return I({hiddenColumns:a,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,p=h>0?i+1:d+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:p,colIndex:t[o.accessor]}),o.children){var g=!0;o.children.forEach((function(e){I({hiddenColumns:a,header:e,pinned:l})&&(r(e,i+1,g),g=!1)}))}return v-f},o=i.current.filter((function(e){return I({hiddenColumns:a,header:e,pinned:l})})),c=!0;return o.forEach((function(e){r(e,1,c),c=!1})),e}),[i,a,d,l,t]);return e("div",m({className:"st-header-".concat(l?"pinned-".concat(l):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:r,display:"grid",position:"relative"}},{children:e(ne,m({rowIndex:0},{children:p.map((function(n){return e(me,{colIndex:n.colIndex,forceHeadersUpdate:h,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:v(),reverse:"right"===l,sort:u},n.header.accessor)}))}))}))},ge=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(ge)):1},we=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,d=t.mainTemplateColumns,l=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,p=D(),g=p.mainBodyRef,w=p.pinnedLeftRef,C=p.pinnedRightRef,y=p.setPinnedLeftWidth,x=p.setPinnedRightWidth;se(g,r);var b=c((function(){return de({headersRef:i,hiddenColumns:a,pinnedLeftColumns:l,pinnedRightColumns:h})}),[i,a,l,h]),R=c((function(){var e=i.current,n=0;return e.forEach((function(e){if(I({hiddenColumns:a,header:e})){var t=ge(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return u((function(){var e,n;y(ue(null===(e=w.current)||void 0===e?void 0:e.clientWidth)),x(ue(null===(n=C.current)||void 0===n?void 0:n.clientWidth))}),[w,C,y,x]),n("div",m({className:"st-header-container",ref:o},{children:[l.length>0&&e(pe,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"left",sectionRef:w,sort:v}),e(pe,{columnIndices:b,gridTemplateColumns:d,handleScroll:function(e){var n,t,o=null===(n=r.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(t=g.current)||void 0===t||t.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:R,sectionRef:r,sort:v}),h.length>0&&e(pe,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"right",sectionRef:C,sort:v})]}))},Ce=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):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(" "))},Ie=function(t){var r=t.flattenedRows,i=t.isWidthDragging,a=t.pinnedLeftWidth,d=t.pinnedRightWidth,l=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=D(),v=f.columnResizing,p=f.editColumns,g=f.headersRef,w=f.hiddenColumns,C=o(null),I=o(null),y=g.current.filter((function(e){return!e.pinned})),x=g.current.filter((function(e){return"left"===e.pinned})),b=g.current.filter((function(e){return"right"===e.pinned})),R=c((function(){return Ce({headers:x,hiddenColumns:w})}),[x,w]),M=c((function(){return Ce({headers:y,hiddenColumns:w})}),[y,w]),E=c((function(){return Ce({headers:b,hiddenColumns:w})}),[b,w]),S={centerHeaderRef:I,headerContainerRef:C,headersRef:g,hiddenColumns:w,mainTemplateColumns:M,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:E,sort:u},k={flattenedRows:r,headerContainerRef:C,isWidthDragging:i,mainTemplateColumns:M,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:E,pinnedRightWidth:d,setFlattenedRows:l,setScrollTop:s,visibleRows:h};return n("div",m({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:p?"calc(100% - 27.5px)":"100%"}},{children:[e(we,m({},S)),e(le,m({},k))]}))},ye=function(i){var c,d,l=i.mainBodyWidth,s=i.mainBodyRef,u=i.pinnedLeftWidth,h=i.pinnedRightWidth,f=i.setMainBodyWidth,v=i.tableBodyContainerRef,p=D().editColumns,g=r(!1),w=g[0],C=g[1],I=o(null),y=v.current&&v.current.scrollHeight>v.current.clientHeight,x=p?28:0,b=(p?h+1:h)+(v.current&&y?v.current.offsetWidth-v.current.clientWidth:0);return se(s,I),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.scrollWidth;f(e)}}()}),1)}),[s,f]),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.clientWidth;C(l>e)}}()}),1)}),[s,l,f]),w?n("div",m({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(c=I.current)||void 0===c?void 0:c.offsetHeight}}),l>0&&e("div",m({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&s.current&&s.current.scrollTo({left:n,behavior:"auto"})},ref:I,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})})),h>0&&e(t,{children:e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:b,height:null===(d=I.current)||void 0===d?void 0:d.offsetHeight}})}),x>0&&e("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},xe={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 xe.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?xe.string(e,n,t):"number"==typeof e&&"number"==typeof n?xe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?xe.boolean(e,n,t):xe.string(String(e),String(n),t)}},be=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 xe.number(i,a,r)}return"date"===t?xe.date(String(e),String(n),r):"boolean"===t?xe.boolean(Boolean(e),Boolean(n),r):"enum"===t?xe.enum(String(e),String(n),r):xe.string(String(e),String(n),r)},Re=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,c=new Map,d="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();d=r,c.set(d,e),a.has(d)||a.set(d,[])}else if(d){var o=a.get(d)||[];o.push(e),a.set(d,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(t=a.get(i))||void 0===t||t.push(e)}}));var l=[];return a.forEach((function(e,r){if(c.has(r)){var a=c.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=Me(a.rowMeta.children,n,t)),l.push(a)}var d=w([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return be(a,c,o,i)}));l.push.apply(l,d.map((function(e){var r=m({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=Me(r.rowMeta.children,n,t);r.rowMeta=m(m({},r.rowMeta),{children:o})}return r})))})),l},Me=function(e,n,t){var r=t.find((function(e){return e.accessor===n.key.accessor})),o=(null==r?void 0:r.type)||"string",i=n.direction;return w([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],c=t.rowData[r];return be(a,c,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?m(m({},e),{rowMeta:m(m({},e.rowMeta),{children:Me(e.rowMeta.children,n,t)})}):e}))},Ee=function(e){var n=e.headers,t=e.tableRows,o=r(null),i=o[0],a=o[1],d=c((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),l=r(d),s=l[0],u=l[1],h=c((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:Re(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Se=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("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("span",{className:"st-checkbox-checkmark"})})),i]}))},ke=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),d=!1;if(!c)for(var l=0,s=a.children;l<s.length;l++){var u=s[l];if(ke([u],n,t,r),!1===t[u.accessor]){d=!0;break}}(c||d)&&(t[a.accessor]=!1)}}},De=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},We=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(We(e.children,n),De(e.children,n)&&(n[e.accessor]=!0))}))},Ne=function(o){var i=o.allHeaders,a=o.depth,c=void 0===a?0:a,d=o.header,l=o.hiddenColumns,s=o.setHiddenColumns,u=r(!0),h=u[0],f=u[1],v=D(),p=v.expandIcon,g=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,y=v.setPinnedRightWidth,R="".concat(16*c,"px"),M=d.children&&d.children.length>0,E=l[d.accessor]||M&&d.children&&De(d.children,l);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:R}},{children:[e("div",m({className:"st-header-icon-container"},{children:M?e("div",m({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?g:p})):null})),e(Se,m({checked:E,onChange:function(e){var n=m({},l);(n[d.accessor]=e,e)?We(i,n):(ke(i,d.accessor,n),M&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===l[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,ke(i,d.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=x(e).reduce((function(e,n){return e+b(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var d=ue(i),l=ue(a);r(d),o(l),t(c)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:y})}},{children:d.label}))]})),M&&h&&d.children&&e("div",m({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e(Ne,{allHeaders:i,depth:c+1,header:n,hiddenColumns:l,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},He=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,c="left"===o?"left":"";return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(Ne,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},Le=function(t){var o=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,c=t.headers,d=t.hiddenColumns,l=t.position,s=void 0===l?"right":l,u=t.setHiddenColumns,h=r(a),f=h[0],v=h[1];return i?n("div",m({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:o})),e(He,{headers:c,open:f,position:s,setHiddenColumns:u,hiddenColumns:d})]})):null},Te=function(n){var t=r(!1),o=t[0],i=t[1];return a((function(){i(!0)}),[]),o?e(Be,m({},n)):null},Be=function(t){var d=t.allowAnimations,l=void 0!==d&&d,s=t.cellUpdateFlash,h=void 0!==s&&s,v=t.collapseIcon,p=void 0===v?e(T,{className:"st-sort-icon"}):v,g=t.columnEditorPosition,w=void 0===g?"right":g,C=t.columnEditorText,I=void 0===C?"Columns":C,b=t.columnReordering,R=void 0!==b&&b,M=t.columnResizing,S=void 0!==M&&M,D=t.defaultHeaders,B=t.editColumns,O=void 0!==B&&B,P=t.editColumnsInitOpen,F=void 0!==P&&P,A=t.expandIcon,z=void 0===A?e(H,{className:"st-sort-icon"}):A,U=t.height,j=t.hideFooter,Y=void 0!==j&&j,q=t.nextIcon,J=void 0===q?e(H,{className:"st-next-prev-icon"}):q,V=t.onCellEdit,K=t.onColumnOrderChange,X=t.onGridReady,G=t.onNextPage,$=t.prevIcon,_=void 0===$?e(N,{className:"st-next-prev-icon"}):$,Q=t.rowHeight,Z=void 0===Q?40:Q,ee=t.rows,ne=t.rowsPerPage,te=void 0===ne?10:ne,re=t.selectableCells,oe=void 0!==re&&re,ie=t.selectableColumns,ae=void 0!==ie&&ie,ce=t.shouldPaginate,de=void 0!==ce&&ce,le=t.sortDownIcon,se=void 0===le?e(T,{className:"st-sort-icon"}):le,ue=t.sortUpIcon,he=void 0===ue?e(L,{className:"st-sort-icon"}):ue,fe=t.tableRef,ve=t.theme,me=void 0===ve?"light":ve,pe=o(null),ge=o(D),we=o(null),Ce=o(null),xe=o(null),be=o(null),Re=o(null),Me=r(1),Se=Me[0],ke=Me[1],De=r(!1),We=De[0],Ne=De[1],He=r(0),Te=He[0],Be=He[1],Oe=r(0),Pe=Oe[0],Fe=Oe[1],Ae=r(0),ze=Ae[0],Ue=Ae[1],je=r(0),Ye=je[0],qe=je[1],Je=r(0),Ve=Je[0],Ke=Je[1],Xe=Ee({headers:ge.current,tableRows:ee}),Ge=Xe.sort,$e=Xe.sortedRows,_e=Xe.hiddenColumns,Qe=Xe.setHiddenColumns,Ze=Xe.updateSort;a((function(){null==X||X()}),[X]);var en=c((function(){if(!de)return $e;var e=(Se-1)*te,n=e+te;return $e.slice(e,n)}),[Se,te,de,$e]),nn=r(en),tn=nn[0],rn=nn[1];a((function(){rn(en)}),[en]);var on=c((function(){var e;if(!U)return window.innerHeight-Z;var n=document.querySelector(".simple-table-root"),t=0;if(U.endsWith("px"))t=parseInt(U,10);else if(U.endsWith("vh")){var r=parseInt(U,10);t=window.innerHeight*r/100}else if(U.endsWith("%")){var o=parseInt(U,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-Z)}),[U,Z]),an=c((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],d=0,l=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=d*a;if(h>=s)break;h+a>l&&c.push({row:i,depth:n,position:d,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),d+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:on,flattenedRows:tn,rowHeight:Z,scrollTop:Ye})}),[on,Z,tn,Ye]),cn=f((function(e){return e+1}),0)[1],dn=function(e){var n=e.selectableCells,t=e.headers,d=e.visibleRows,l=r(new Set),s=l[0],u=l[1],h=r(new Set),f=h[0],v=h[1],m=r(null),p=m[0],g=m[1],w=r(null),C=w[0],I=w[1],y=o(!1),b=o(null),R=i((function(){var e=t.flatMap(x).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var r=Array.from(s).reduce((function(e,t){var r=t.split("-").map(Number),o=r[0],i=r[1];e[o]||(e[o]=[]);var a=n.get(i);return e[o][i]=a?d[o].row.rowData[a]:"",e}),{}),o=Object.values(r).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(o)}),[t,s,d]),M=i((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),c=r;c<=o;c++)for(var l=i;l<=a;l++)if(c>=0&&c<d.length){var s=d[c].row.rowMeta.rowId;t.add(E({colIndex:l,rowIndex:c,rowId:s}))}v(new Set),g(null),u(t)}),[d,v,g,u]),S=i((function(e){if(e.rowIndex>=0&&e.rowIndex<d.length&&e.colIndex>=0&&e.colIndex<t.length){var n=E(e);v(new Set),g(null),u(new Set([n])),I(e)}}),[t.length,d.length,v,g,u,I]),k=i((function(e,n){void 0===n&&(n=!1),u(new Set),I(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&g(e[e.length-1])}),[u,I,v,g]);a((function(){var e=function(e){if(n&&C){var r=C.rowIndex,o=C.colIndex,i=C.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(d[r].row.rowMeta.rowId!==i){var a=d.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;r=a}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c={rowIndex:r-1,colIndex:o,rowId:d[r-1].row.rowMeta.rowId};S(c)}}else"ArrowDown"===e.key?(e.preventDefault(),r<d.length-1&&(c={rowIndex:r+1,colIndex:o,rowId:d[r+1].row.rowMeta.rowId},S(c))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(c={rowIndex:r,colIndex:o-1,rowId:d[r].row.rowMeta.rowId},S(c))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<t.length-1&&(c={rowIndex:r,colIndex:o+1,rowId:d[r].row.rowMeta.rowId},S(c))):"Escape"===e.key&&(u(new Set),v(new Set),g(null),b.current=null,I(null))}else R()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[R,t.length,C,M,S,n,d]);var D=i((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=E({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),W=i((function(e){var n,t,r,o,i,a,c=e.colIndex,l=e.rowIndex,s=e.rowId,u=[],h=null===(r=null===(t=null===(n=d[l-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:c,rowIndex:l+1,rowId:null===(a=null===(i=null===(o=d[l+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},m={colIndex:c-1,rowIndex:l,rowId:s},p={colIndex:c+1,rowIndex:l,rowId:s};return(!D({colIndex:c,rowIndex:l-1,rowId:h})||f.has(c)&&0===l)&&u.push("st-selected-top-border"),(!D(v)||f.has(c)&&l===d.length-1)&&u.push("st-selected-bottom-border"),D(m)||u.push("st-selected-left-border"),D(p)||u.push("st-selected-right-border"),u.join(" ")}),[D,d,f]),N=c((function(){return C?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===C.rowIndex&&t===C.colIndex&&r===C.rowId}:function(){return!1}}),[C]);return{getBorderClass:W,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){y.current=!0,b.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),g(null);var i=E({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),I({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,r=e.rowIndex;if(e.rowId,n&&y.current&&b.current){for(var o=new Set,i=Math.min(b.current.rowIndex,r),a=Math.max(b.current.rowIndex,r),c=Math.min(b.current.colIndex,t),l=Math.max(b.current.colIndex,t),s=i;s<=a;s++)for(var h=c;h<=l;h++)if(s>=0&&s<d.length){var f=d[s].row.rowMeta.rowId;o.add(E({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){y.current=!1},isInitialFocusedCell:N,isSelected:D,lastSelectedColumnIndex:p,selectColumns:k,selectedCells:s,selectedColumns:f,setInitialFocusedCell:I,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:oe,headers:ge.current,visibleRows:an}),ln=dn.getBorderClass,sn=dn.handleMouseDown,un=dn.handleMouseOver,hn=dn.handleMouseUp,fn=dn.isInitialFocusedCell,vn=dn.isSelected,mn=dn.selectColumns,pn=dn.selectedCells,gn=dn.selectedColumns,wn=dn.setInitialFocusedCell,Cn=dn.setSelectedCells,In=dn.setSelectedColumns,yn=i((function(e,n){Ze(e,n)}),[Ze]),xn=i((function(e){ge.current=e,cn()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ae&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(pn.size>0&&Cn(new Set),gn.size>0&&In(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ae,pn,gn,Cn,In]),u((function(){if(Re.current){var e=Re.current.offsetWidth-Re.current.clientWidth;Ke(e)}}),[]),u((function(){var e=function(){if(cn(),Re.current){var e=Re.current.offsetWidth-Re.current.clientWidth;Ke(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var bn=o(new Map);return a((function(){fe&&(fe.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==ee?void 0:ee[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var l=y({rowId:d,accessor:i}),s=bn.current.get(l);s&&s.updateContent(c),void 0!==(null===(o=null===(r=null==ee?void 0:ee[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(ee[a].rowData[i]=c)}}})}),[fe,ee]),e(k,m({value:{allowAnimations:l,cellRegistry:bn.current,cellUpdateFlash:h,collapseIcon:p,columnReordering:R,columnResizing:S,draggedHeaderRef:pe,editColumns:O,expandIcon:z,forceUpdate:cn,getBorderClass:ln,handleMouseDown:sn,handleMouseOver:un,headersRef:ge,hiddenColumns:_e,hoveredHeaderRef:we,isInitialFocusedCell:fn,isSelected:vn,mainBodyRef:Ce,nextIcon:J,onCellEdit:V,onColumnOrderChange:K,onSort:yn,onTableHeaderDragEnd:xn,pinnedLeftRef:xe,pinnedRightRef:be,prevIcon:_,rowHeight:Z,scrollbarWidth:Ve,selectColumns:mn,selectableColumns:ae,setInitialFocusedCell:wn,setIsWidthDragging:Ne,setMainBodyWidth:Be,setPinnedLeftWidth:Fe,setPinnedRightWidth:Ue,setSelectedCells:Cn,setSelectedColumns:In,shouldPaginate:de,sortDownIcon:se,sortUpIcon:he,tableBodyContainerRef:Re}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(me),style:U?{height:U}:{}},{children:n("div",m({className:"st-wrapper-container"},{children:[n("div",m({className:"st-content-wrapper",onMouseUp:hn,onMouseLeave:hn},{children:[e(Ie,{flattenedRows:tn,isWidthDragging:We,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setFlattenedRows:rn,setScrollTop:qe,sort:Ge,visibleRows:an}),e(Le,{columnEditorText:I,editColumns:O,editColumnsInitOpen:F,headers:ge.current,hiddenColumns:_e,position:w,setHiddenColumns:Qe})]})),e(ye,{mainBodyRef:Ce,mainBodyWidth:Te,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setMainBodyWidth:Be,tableBodyContainerRef:Re}),e(W,{currentPage:Se,hideFooter:Y,onPageChange:ke,onNextPage:G,shouldPaginate:de,totalPages:Math.ceil(ee.length/te)})]}))}))}))};export{Te as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=function(){return t=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},t.apply(this,arguments)};function r(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((r=r.apply(e,n||[])).next())}))}function o(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=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}function i(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 a=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},c=n.createContext(void 0),s=function(n){var r=n.children,o=n.value;return e.jsx(c.Provider,t({value:o},{children:r}))},d=function(){var e=n.useContext(c);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},l=function(i){var a=i.currentPage,c=i.hideFooter,s=i.onPageChange,l=i.onNextPage,u=i.shouldPaginate,h=i.totalPages,f=d(),v=f.nextIcon,m=f.prevIcon,g=n.useState(!0),p=g[0],w=g[1],x=!(a>1),C=!(a<h)&&!l||!p&&a===h;if(c||!u)return null;var I=function(){if(h<=15)return Array.from({length:h},(function(e,n){return n+1}));var e,n,t=[],r=15;if(a<=Math.ceil(7.5))e=1,n=14;else if(a>=h-Math.floor(7.5))e=Math.max(1,h-r+1),n=h;else{var o=Math.floor(7);e=a-o,n=a+(r-o-1)}for(var i=e;i<=n;i++)t.push(i);return n<h-1&&(t.push(-1),t.push(h)),t}();return e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){var e=a-1;e>=1&&s(e)},disabled:x},{children:m})),e.jsx("button",t({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return r(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(t){switch(t.label){case 0:return e=a===h,n=a+1,l&&e?[4,l(a)]:[3,2];case 1:if(!t.sent())return w(!1),[2];t.label=2;case 2:return(n<=h||l)&&s(n),[2]}}))}))},disabled:C},{children:v})),I.map((function(n,r){return n<0?e.jsx("span",t({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",t({onClick:function(){return function(e){e>=1&&e<=h&&s(e)}(n)},className:"st-page-btn ".concat(a===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},u=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},h=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},f=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},v=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},m=function(e){return e.position*(e.rowHeight+1)-1},g=function(e){return e.position*(e.rowHeight+1)},p=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},w=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},x=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},C=function(r){var o=r.children,i=r.onClose,a=r.open,c=r.setOpen,s=r.width,l=r.containerRef,u=d(),h=null==u?void 0:u.mainBodyRef,f=n.useRef(null),v=n.useRef(null),m=n.useState("bottom-left"),g=m[0],p=m[1],w=n.useState({}),x=w[0],C=w[1],I=n.useState(!1),y=I[0],b=I[1];return n.useEffect((function(){a&&f.current?(b(!1),!v.current&&f.current.parentElement&&(v.current=f.current.parentElement),requestAnimationFrame((function(){if(f.current&&v.current){var e,n=f.current,t=v.current.getBoundingClientRect(),r=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==l?void 0:l.current)?l.current.getBoundingClientRect():(null==h?void 0:h.current)?h.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,c="bottom",d={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var u="left";o>e.right-t.right+t.width&&(u="right"),"bottom"===c?d.top=t.bottom+4:d.bottom=window.innerHeight-t.top+4,"left"===u?d.left=t.left:d.right=window.innerWidth-t.right,p("".concat(c,"-").concat(u)),C(d),b(!0)}}))):a||b(!1)}),[a,s,l,h]),n.useEffect((function(){var e=function(e){if(a&&f.current){var n=e.target;f.current&&!f.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,i,c]),n.useEffect((function(){var e=function(e){f.current&&!f.current.contains(e.target)&&(c(!1),null==i||i())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,a,c]),n.useEffect((function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,a,c]),a?e.jsx("div",t({ref:f,className:"st-dropdown-content st-dropdown-".concat(g),style:t({width:s?"".concat(s,"px"):"auto",visibility:y?"visible":"hidden"},x)},{children:o})):null},I=function(n){var r=n.children,o=n.onClick,i=n.isSelected,a=void 0!==i&&i,c=n.disabled,s=void 0!==c&&c,d=n.className,l=void 0===d?"":d;return e.jsx("div",t({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(s?"disabled":""," ").concat(l),onClick:function(){!s&&o&&o()},role:"option","aria-selected":a,"aria-disabled":s},{children:r}))},y=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.setOpen,s=r.value,d=n.useState(s),l=d[0],u=d[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(e){u(e),i(e),c(!1),o()};return e.jsxs(C,t({open:a,onClose:function(){o()},setOpen:c,width:120},{children:[e.jsx(I,t({isSelected:!0===l,onClick:function(){return h(!0)}},{children:"True"})),e.jsx(I,t({isSelected:!1===l,onClick:function(){return h(!1)}},{children:"False"}))]}))},b=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},R=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},M=function(r){var o,i,a=r.value,c=r.onChange,s=r.onClose,l=d(),u=l.nextIcon,h=l.prevIcon,f=n.useState(a||new Date),v=f[0],m=f[1],g=n.useState("days"),p=g[0],w=g[1],x=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",t({className:"st-datepicker"},{children:[e.jsxs("div",t({className:"st-datepicker-header"},{children:["days"===p&&e.jsxs(e.Fragment,{children:[e.jsx("button",t({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),e.jsxs("div",t({className:"st-datepicker-header-label",onClick:function(){return w("months")}},{children:[(i=v,i.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e.jsx("button",t({onClick:function(){m(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===p&&e.jsx("div",t({className:"st-datepicker-header-label",onClick:function(){return w("years")}},{children:v.getFullYear()})),"years"===p&&e.jsx("div",t({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",t({className:"st-datepicker-grid st-datepicker-".concat(p,"-grid")},{children:["days"===p&&function(){var n=[],r=v.getFullYear(),o=v.getMonth(),i=x(r,o),d=function(e,n){return new Date(e,n,1).getDay()}(r,o),l=x(r,o-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(r,o){n.push(e.jsx("div",t({className:"st-datepicker-weekday"},{children:r}),"header-".concat(o)))}));for(var u=function(r){var o=l-d+r+1;n.push(e.jsx("div",t({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);m(n),c(n),null==s||s()}(o)}},{children:o}),"prev-".concat(o)))},h=0;h<d;h++)u(h);for(var f=function(i){var d=i===(new Date).getDate()&&o===(new Date).getMonth()&&r===(new Date).getFullYear(),l=i===new Date(a).getDate()&&o===new Date(a).getMonth()&&r===new Date(a).getFullYear();n.push(e.jsx("div",t({className:"st-datepicker-day ".concat(d?"today":""," ").concat(l?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);m(n),c(n),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)f(g);var p=35-(d+i),w=function(r){n.push(e.jsx("div",t({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);m(n),c(n),null==s||s()}(r)}},{children:r}),"next-".concat(r)))};for(g=1;g<=p;g++)w(g);return n}(),"months"===p&&(o=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,r){var i=r===v.getMonth();o.push(e.jsx("div",t({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){m(new Date(v.getFullYear(),e,1)),w("days")}(r)}},{children:n}),"month-".concat(r)))})),o),"years"===p&&function(){for(var n=[],r=v.getFullYear(),o=r-6,i=function(o){var i=o===r;n.push(e.jsx("div",t({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){m(new Date(e,v.getMonth(),1)),w("months")}(o)}},{children:o}),"year-".concat(o)))},a=o;a<o+12;a++)i(a);return n}()]})),e.jsx("div",t({className:"st-datepicker-footer"},{children:e.jsx("button",t({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;m(e),c(e),null==s||s()}},{children:"Today"}))}))]}))},S=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.setOpen,s=r.value,d=n.useState(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(s)),l=d[0],u=d[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){o()};return e.jsx(C,t({open:a,onClose:h,setOpen:c,width:280},{children:e.jsx(M,{value:l,onChange:function(e){u(e),i(e.toISOString()),c(!1),o()},onClose:h})}))},E=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.options,s=r.setOpen,d=r.value,l=n.useState(d||""),u=l[0],h=l[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e.jsx(C,t({open:a,onClose:function(){o()},setOpen:s,width:150},{children:e.jsx("div",t({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e.jsx(I,t({isSelected:u===n,onClick:function(){return h(e=n),i(e),s(!1),void o();var e}},{children:n}),n)}))}))}))},j=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,s=n.value,d=function(){i(!1)};if("boolean"===c&&"boolean"==typeof s)return e.jsx(y,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:s});if("date"===c){var l="string"==typeof s?s:"";return e.jsx(S,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l})}if("enum"===c){var u="string"==typeof s?s:"";return e.jsx(E,{onBlur:d,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:u})}if("number"===c&&"number"==typeof s)return e.jsx(R,{defaultValue:s,onBlur:d,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var h=null==s?"":String(s);return e.jsx(b,{defaultValue:h,onBlur:d,onChange:function(e){return o(e)}})},k=0,D=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===k||o-k>=r)&&(k=o,n(t))}},W=Date.now(),N={screenX:0,screenY:0},H=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 i(i([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=H(o.children,n,i(i([],t,!0),[r],!1));if(a)return a}}return null};var L=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,d=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,W=Date.now()},handleDragOver:function(e){var n,t,r=e.event,c=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-N.screenX,2)+Math.pow(h-N.screenY,2));a.current=c;var v=i.current,m=H(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=H(v,c.accessor);if(m&&g){var p=m.length,w=g.length,x=g;if(p!==w){var C=w-p;C>0&&(x=g.slice(0,-C))}var I=function(e,n,t){var r=JSON.parse(JSON.stringify(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 c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,x),y=I.newHeaders,b=I.emergencyBreak;if(!(l||c.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===m.length||0===x.length||JSON.stringify(y)===JSON.stringify(i.current)||b)){var R=Date.now();JSON.stringify(y)===JSON.stringify(d)&&(R-W<1500||f<40)||(W=R,N={screenX:u,screenY:h},s(y))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==c||c(i.current)}}},T=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},B=n.forwardRef((function(r,o){var i,a,c=r.borderClass,s=r.colIndex,l=r.header,u=r.isHighlighted,h=r.isInitialFocused,f=r.onExpandRowClick,v=r.rowIndex,m=r.visibleRow,g=d(),w=g.cellRegistry,C=g.cellUpdateFlash,I=g.collapseIcon,y=g.draggedHeaderRef,b=g.expandIcon,R=g.handleMouseDown,M=g.handleMouseOver,S=g.headersRef,E=g.hoveredHeaderRef,k=g.onCellEdit,W=g.onTableHeaderDragEnd,N=m.depth,H=m.row,B=n.useState(H.rowData[l.accessor]),O=B[0],P=B[1],F=n.useState(!1),A=F[0],U=F[1],z=n.useState(!1),Y=z[0],q=z[1],J=n.useRef(null),V=L({draggedHeaderRef:y,headersRef:S,hoveredHeaderRef:E,onTableHeaderDragEnd:W}).handleDragOver,K=D(),X="cell-".concat(v,"-").concat(s),G=x({rowId:H.rowMeta.rowId,accessor:l.accessor});n.useEffect((function(){if(w){var e="".concat(H.rowMeta.rowId,"-").concat(l.accessor);return w.set(e,{updateContent:function(e){O!==e?(P(e),C&&(q(!0),J.current&&clearTimeout(J.current),J.current=setTimeout((function(){q(!1)}),800))):P(e)}}),function(){w.delete(e),J.current&&clearTimeout(J.current)}}}),[w,C,H.rowMeta.rowId,l.accessor,O]),n.useEffect((function(){if(Y){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[Y]),n.useEffect((function(){P(H.rowData[l.accessor])}),[H.rowData,l.accessor]),n.useEffect((function(){u||U(!1)}),[u]);var _="boolean"===l.type||"date"===l.type||"enum"===l.type,$=Boolean(null===(a=null===(i=H.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),Q=Boolean(null==l?void 0:l.isEditable),Z="st-cell ".concat(N>0&&l.expandable?"st-cell-depth-".concat(N):""," ").concat(u?h?"st-cell-selected-first ".concat(c):"st-cell-selected ".concat(c):""," ").concat(Q?"clickable":""," ").concat(Y?"st-cell-updating":""),ee=n.useCallback((function(e){P(e),null==k||k({accessor:l.accessor,newValue:e,row:H})}),[l.accessor,k,H]);return A&&!_?e.jsx("div",t({className:"st-cell-editing",id:p({accessor:l.accessor,rowIndex:v+1})},{children:e.jsx(j,{enumOptions:l.enumOptions,onChange:ee,setIsEditing:U,type:l.type,value:O})})):e.jsxs("div",t({className:Z,id:X,onDoubleClick:function(){return l.isEditable&&U(!0)},onMouseDown:function(){return R({rowIndex:v,colIndex:s,rowId:H.rowMeta.rowId})},onMouseOver:function(){return M({rowIndex:v,colIndex:s,rowId:H.rowMeta.rowId})},onDragOver:function(e){return K({callback:V,callbackProps:{event:e,hoveredHeader:l},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!l.isEditable||A||(e.preventDefault(),U(!0))},ref:o,"data-row-index":v,"data-col-index":s,"data-row-id":H.rowMeta.rowId,"data-accessor":l.accessor},{children:[l.expandable&&$?H.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return f(H.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):null,e.jsx("span",t({className:"st-cell-content ".concat("right"===l.align?"right-aligned":"center"===l.align?"center-aligned":"")},{children:l.cellRenderer?l.cellRenderer({accessor:l.accessor,colIndex:s,row:H}):T({content:O,header:l})})),A&&_&&e.jsx(j,{enumOptions:l.enumOptions,onChange:ee,setIsEditing:U,type:l.type,value:O})]}),G)})),O=function(n){var r=n.children,o=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"]);return d().allowAnimations?e.jsx(P,t({},o,{children:r})):e.jsx(e.Fragment,{children:r})},P=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,a=t.rowIndex,c=n.useRef(!1),s=d(),l=s.draggedHeaderRef,u=s.headersRef,h=s.mainBodyRef,f=s.shouldPaginate,v=n.useState({}),m=v[0],g=v[1],w=n.useRef({}),x=u.current;return n.useLayoutEffect((function(){if(x){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(p({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),c=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=c}}})),o}({currentHeaders:x,draggedHeaderRef:l,rowIndex:a});JSON.stringify(e)!==JSON.stringify(m)&&(w.current=m,g(e))}}),[m,x,l,o,a]),n.useLayoutEffect((function(){var e=h.current,n=function(){c.current=!0},t=function(){c.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[l,h]),n.useEffect((function(){i||c.current||Object.keys(w.current).length&&x&&x.forEach((function(e){var n=document.getElementById(p({accessor:e.accessor,rowIndex:a}));if(n){var t=w.current[e.accessor],r=m[e.accessor];if(t&&r){var o=t.left-r.left,i=f?0:t.top-r.top,c=Math.abs(o),s=Math.abs(i);(c>10||s>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[m,x,o,i,w,a,f]),e.jsx(e.Fragment,{children:r})},F=function(n){var r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,c=n.onExpandRowClick,s=n.pinned,d=n.rowIndex,l=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return w({hiddenColumns:i,header:e,pinned:s})}));return e.jsx(O,t({isBody:!0,pauseAnimation:a,rowIndex:d+1},{children:h.map((function(n){return e.jsx(A,{columnIndices:r,header:n,headers:o,hiddenColumns:i,onExpandRowClick:c,pinned:s,rowIndex:d,rowIndices:l,visibleRow:u},p({accessor:n.accessor,rowIndex:d+1}))}))}))},A=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.hiddenColumns,c=t.onExpandRowClick,s=t.pinned,l=t.rowIndex,u=t.rowIndices,h=t.visibleRow,f=r[o.accessor],v=d(),m=v.getBorderClass,g=v.isSelected,x=v.isInitialFocusedCell;if(o.children){var C=o.children.filter((function(e){return w({hiddenColumns:a,header:e,pinned:s})}));return e.jsx(n.Fragment,{children:C.map((function(n){return e.jsx(A,{columnIndices:r,header:n,headers:i,hiddenColumns:a,onExpandRowClick:c,pinned:s,rowIndex:l,rowIndices:u,visibleRow:h},p({accessor:n.accessor,rowIndex:l+1}))}))})}var I={rowIndex:l,colIndex:f,rowId:h.row.rowMeta.rowId},y=m(I),b=g(I),R=x(I);return e.jsx(B,{borderClass:y,colIndex:f,header:o,isHighlighted:b,isInitialFocused:R,onExpandRowClick:c,rowIndex:l,visibleRow:h},p({accessor:o.accessor,rowIndex:l+1}))},U=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,c=n.index,s=n.isWidthDragging,d=n.onExpandRowClick,l=n.pinned,u=n.rowHeight,h=n.rowIndices,f=n.visibleRow,v=f.position,m=v%2==0;return e.jsx("div",t({className:"st-row ".concat(m?"even":"odd"),style:{gridTemplateColumns:o,top:g({position:v,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(F,{columnIndices:r,headers:i,hiddenColumns:a,isWidthDragging:s,onExpandRowClick:d,pinned:l,rowIndex:c,rowIndices:h,visibleRow:f},c)}))},z=function(n){var r=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",t({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:m({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Y=function(r){var o=r.columnIndices,i=r.headers,a=r.hiddenColumns,c=r.isWidthDragging,s=r.onExpandRowClick,d=r.pinned,l=r.ref,u=r.rowHeight,h=r.rowIndices,f=r.templateColumns,v=r.totalHeight,m=r.visibleRows,g=r.width,p=d?"st-body-pinned-".concat(d):"st-body-main";return e.jsx("div",t({className:p,ref:l,style:t({position:"relative",height:"".concat(v,"px"),width:g},!d&&{flexGrow:1})},{children:m.map((function(t,r){var l,v,g=m[r-1],p=Boolean((null==g?void 0:g.depth)!==(null==t?void 0:t.depth)&&(null===(v=null===(l=null==t?void 0:t.row.rowMeta)||void 0===l?void 0:l.children)||void 0===v?void 0:v.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(z,{displayStrongBorder:p,position:t.position,rowHeight:u,templateColumns:f}),e.jsx(U,{columnIndices:o,gridTemplateColumns:f,headers:i,hiddenColumns:a,index:r,isWidthDragging:c,onExpandRowClick:s,pinned:d,rowHeight:u,rowIndices:h,visibleRow:t})]},t.position)}))}))};function q(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return w({hiddenColumns:t,header:e})})).forEach((function(e,n){c(e,0===n)}))};return r.forEach((function(e,n){c(e,0===n)})),n.current.filter((function(e){return!e.pinned&&w({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;c(e,t)})),o.forEach((function(e){c(e,!1)})),i}var J=function(r){var o=r.flattenedRows,i=r.headerContainerRef,a=r.isWidthDragging,c=r.mainTemplateColumns,s=r.pinnedLeftColumns,l=r.pinnedLeftTemplateColumns,u=r.pinnedLeftWidth,h=r.pinnedRightColumns,f=r.pinnedRightTemplateColumns,v=r.pinnedRightWidth,m=r.setFlattenedRows,g=r.setScrollTop,p=r.visibleRows,w=d(),x=w.headersRef,C=w.hiddenColumns,I=w.mainBodyRef,y=w.rowHeight,b=w.scrollbarWidth,R=w.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],c=i[1];n.useEffect((function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:R,scrollbarWidth:b});var M,S,E=n.useRef(null),j=(M=0,(S=function(e){e.forEach((function(e){M+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&S(e.rowMeta.children)}))})(o),M)*(y+1)-1,k=n.useMemo((function(){return q({headersRef:x,hiddenColumns:C,pinnedLeftColumns:s,pinnedRightColumns:h})}),[x,C,s,h]),D=n.useMemo((function(){var e={};return p.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[p]),W=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};m((function(e){return e.map(n)}))},N={headerContainerRef:i,headers:x.current,hiddenColumns:C,isWidthDragging:a,rowHeight:y,visibleRows:p,columnIndices:k,rowIndices:D};return e.jsxs("div",t({className:"st-body-container",ref:R,onScroll:function(e){var n=e.currentTarget.scrollTop;E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame((function(){g(n)}))}},{children:[s.length>0&&e.jsx(Y,t({},N,{onExpandRowClick:W,pinned:"left",templateColumns:l,totalHeight:j,width:u})),e.jsx(Y,t({},N,{ref:I,onExpandRowClick:W,templateColumns:c,totalHeight:j})),h.length>0&&e.jsx(Y,t({},N,{onExpandRowClick:W,pinned:"right",templateColumns:f,totalHeight:j,width:v}))]}))},V=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},K=function(e){return void 0===e&&(e=0),e?e+1:0},X=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return X(e)})):[e]},G=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(p({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},_=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(p({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){_(e)}))},$=function(e){return"number"==typeof e.minWidth?e.minWidth:40},Q=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:X(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=G(e))})))})),n.pinned?K(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},Z=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,s=e.setMainBodyWidth,d=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,u=e.startWidth;c(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=$(i),v=r-o>1,m=v?X(i):[i],g=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&m.length>1)ee({delta:n,header:i,headersRef:a,leafHeaders:m,minWidth:f,setMainBodyWidth:s,setPinnedLeftWidth:d,setPinnedRightWidth:l,startWidth:u});else{var r=Math.max(u+n,f);i.width=r,Q({header:i,headers:a.current,newWidth:r,setMainBodyWidth:s,setPinnedLeftWidth:d,setPinnedRightWidth:l})}a.current.forEach((function(e){_(e)})),t()},p=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p),c(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",p)}},ee=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,d=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,$(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(d+n,l);Q({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:s});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},ne=n.forwardRef((function(r,o){var a,c,s=r.colIndex,l=r.forceHeadersUpdate,u=r.gridColumnEnd,h=r.gridColumnStart,f=r.gridRowEnd,v=r.gridRowStart,m=r.header,g=r.reverse,w=r.sort,x=d(),C=x.columnReordering,I=x.columnResizing,y=x.draggedHeaderRef,b=x.forceUpdate,R=x.headersRef,M=x.hoveredHeaderRef,S=x.onColumnOrderChange,E=x.onSort,j=x.onTableHeaderDragEnd,k=x.rowHeight,W=x.selectColumns,N=x.selectableColumns,H=x.setInitialFocusedCell,T=x.setIsWidthDragging,B=x.setMainBodyWidth,O=x.setPinnedLeftWidth,P=x.setPinnedRightWidth,F=x.setSelectedCells,A=x.setSelectedColumns,U=x.sortDownIcon,z=x.sortUpIcon,Y=Boolean(null==m?void 0:m.isSortable),q="st-header-cell ".concat(m.accessor===(null===(a=M.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(c=y.current)||void 0===c?void 0:c.accessor)===m.accessor?"st-dragging":""," ").concat(Y?"clickable":""," ").concat(C&&!Y?"columnReordering":""," ").concat("right"===(null==m?void 0:m.align)?"right-aligned":"center"===(null==m?void 0:m.align)?"center-aligned":""," ").concat(m.children?"parent":""),J=L({draggedHeaderRef:y,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:S,onTableHeaderDragEnd:j}),V=J.handleDragStart,K=J.handleDragEnd,X=J.handleDragOver,G=D(),_=function(e){var n=e.event,t=e.header;if(N){var r=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 c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,s);return n.shiftKey&&W?A((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],a=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<a&&(a=t,o=e)}));var c,s,d,l,u=i(i([],(c=o,s=n,d=Math.min(c,s),l=Math.max(c,s),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):W&&W(r),F(new Set),void H(null)}t.isSortable&&E(s,t.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var $=I&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;G({callback:Z,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:T,setMainBodyWidth:B,setPinnedLeftWidth:O,setPinnedRightWidth:P,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Q=w&&w.key.accessor===m.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:m})}},{children:["ascending"===w.direction&&z&&z,"descending"===w.direction&&U&&U]}));return e.jsxs("div",t({className:q,id:p({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){G({callback:X,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:t(t({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:u},u-h>1?{}:{width:m.width}),f-v>1?{}:{height:k})},{children:[g&&$,"right"===m.align&&Q,e.jsx("div",t({className:"st-header-label ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":""),draggable:C&&!m.disableReorder,onClick:function(e){return _({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),K(),l()},onDragStart:function(e){C&&m&&function(e){V(e)}(m)}},{children:null==m?void 0:m.label})),"right"!==m.align&&Q,!g&&$]}))})),te=function(r){var o=r.columnIndices,i=r.gridTemplateColumns,a=r.handleScroll,c=r.headersRef,s=r.hiddenColumns,d=r.maxDepth,l=r.pinned,u=r.sectionRef,h=r.sort,f=n.useReducer((function(e){return e+1}),0)[1],v=n.useMemo((function(){var e=[],n=1,t=function(r,i,a){var c,u;if(void 0===a&&(a=!1),!w({hiddenColumns:s,header:r,pinned:l}))return 0;a||n++;var h=null!==(u=null===(c=r.children)||void 0===c?void 0:c.filter((function(e){return w({hiddenColumns:s,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,g=h>0?i+1:d+1;if(e.push({header:r,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:g,colIndex:o[r.accessor]}),r.children){var p=!0;r.children.forEach((function(e){w({hiddenColumns:s,header:e,pinned:l})&&(t(e,i+1,p),p=!1)}))}return v-f},r=c.current.filter((function(e){return w({hiddenColumns:s,header:e,pinned:l})})),i=!0;return r.forEach((function(e){t(e,1,i),i=!1})),e}),[c,s,d,l,o]);return e.jsx("div",t({className:"st-header-".concat(l?"pinned-".concat(l):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(O,t({rowIndex:0},{children:v.map((function(t){return e.jsx(ne,{colIndex:t.colIndex,forceHeadersUpdate:f,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===l,sort:h},t.header.accessor)}))}))}))},re=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(re)):1},oe=function(r){var o=r.centerHeaderRef,i=r.headerContainerRef,a=r.headersRef,c=r.hiddenColumns,s=r.mainTemplateColumns,l=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightTemplateColumns,v=r.sort,m=d(),g=m.mainBodyRef,p=m.pinnedLeftRef,x=m.pinnedRightRef,C=m.setPinnedLeftWidth,I=m.setPinnedRightWidth;V(g,o);var y=n.useMemo((function(){return q({headersRef:a,hiddenColumns:c,pinnedLeftColumns:l,pinnedRightColumns:h})}),[a,c,l,h]),b=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(w({hiddenColumns:c,header:e})){var t=re(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,c]).maxDepth;return n.useLayoutEffect((function(){var e,n;C(K(null===(e=p.current)||void 0===e?void 0:e.clientWidth)),I(K(null===(n=x.current)||void 0===n?void 0:n.clientWidth))}),[p,x,C,I]),e.jsxs("div",t({className:"st-header-container",ref:i},{children:[l.length>0&&e.jsx(te,{columnIndices:y,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:b,pinned:"left",sectionRef:p,sort:v}),e.jsx(te,{columnIndices:y,gridTemplateColumns:s,handleScroll:function(e){var n,t,r=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=g.current)||void 0===t||t.scrollTo(r,0))},headersRef:a,hiddenColumns:c,maxDepth:b,sectionRef:o,sort:v}),h.length>0&&e.jsx(te,{columnIndices:y,gridTemplateColumns:f,handleScroll:void 0,headersRef:a,hiddenColumns:c,maxDepth:b,pinned:"right",sectionRef:x,sort:v})]}))},ie=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):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(" "))},ae=function(r){var o=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,c=r.pinnedRightWidth,s=r.setFlattenedRows,l=r.setScrollTop,u=r.sort,h=r.visibleRows,f=d(),v=f.editColumns,m=f.headersRef,g=f.hiddenColumns,p=n.useRef(null),w=n.useRef(null),x=m.current.filter((function(e){return!e.pinned})),C=m.current.filter((function(e){return"left"===e.pinned})),I=m.current.filter((function(e){return"right"===e.pinned})),y=n.useMemo((function(){return ie({headers:C,hiddenColumns:g})}),[C,g]),b=n.useMemo((function(){return ie({headers:x,hiddenColumns:g})}),[x,g]),R=n.useMemo((function(){return ie({headers:I,hiddenColumns:g})}),[I,g]),M={centerHeaderRef:w,headerContainerRef:p,headersRef:m,hiddenColumns:g,mainTemplateColumns:b,pinnedLeftColumns:C,pinnedLeftTemplateColumns:y,pinnedRightColumns:I,pinnedRightTemplateColumns:R,sort:u},S={flattenedRows:o,headerContainerRef:p,isWidthDragging:i,mainTemplateColumns:b,pinnedLeftColumns:C,pinnedLeftTemplateColumns:y,pinnedLeftWidth:a,pinnedRightColumns:I,pinnedRightTemplateColumns:R,pinnedRightWidth:c,setFlattenedRows:s,setScrollTop:l,visibleRows:h};return e.jsxs("div",t({className:"st-content",style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(oe,t({},M)),e.jsx(J,t({},S))]}))},ce=function(r){var o,i,a=r.mainBodyWidth,c=r.mainBodyRef,s=r.pinnedLeftWidth,l=r.pinnedRightWidth,u=r.setMainBodyWidth,h=r.tableBodyContainerRef,f=d().editColumns,v=n.useState(!1),m=v[0],g=v[1],p=n.useRef(null),w=h.current&&h.current.scrollHeight>h.current.clientHeight,x=f?28:0,C=(f?l+1:l)+(h.current&&w?h.current.offsetWidth-h.current.clientWidth:0);return V(c,p),n.useEffect((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.scrollWidth;u(e)}}()}),1)}),[c,u]),n.useEffect((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.clientWidth;g(a>e)}}()}),1)}),[c,a,u]),m?e.jsxs("div",t({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(o=p.current)||void 0===o?void 0:o.offsetHeight}}),a>0&&e.jsx("div",t({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&c.current&&c.current.scrollTo({left:n,behavior:"auto"})},ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})})),l>0&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}})}),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},se={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 se.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?se.string(e,n,t):"number"==typeof e&&"number"==typeof n?se.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?se.boolean(e,n,t):se.string(String(e),String(n),t)}},de=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 se.number(i,a,r)}return"date"===t?se.date(String(e),String(n),r):"boolean"===t?se.boolean(Boolean(e),Boolean(n),r):"enum"===t?se.enum(String(e),String(n),r):se.string(String(e),String(n),r)},le=function(e,n,r){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",c=n.direction,s=new Map,d=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(s.size)).toString();l=r,d.set(l,e),s.has(l)||s.set(l,[])}else if(l){var o=s.get(l)||[];o.push(e),s.set(l,o)}else{var i="default";s.has(i)||s.set(i,[]),null===(t=s.get(i))||void 0===t||t.push(e)}}));var u=[];return s.forEach((function(e,o){if(d.has(o)){var s=d.get(o);s.rowMeta.children&&s.rowMeta.children.length>0&&(s.rowMeta.children=ue(s.rowMeta.children,n,r)),u.push(s)}var l=i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return de(o,i,a,c)}));u.push.apply(u,l.map((function(e){var o=t({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=ue(o.rowMeta.children,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o})))})),u},ue=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",c=n.direction;return i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return de(o,i,a,c)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:ue(e.rowMeta.children,n,r)})}):e}))},he=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],c=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),s=n.useState(c),d=s[0],l=s[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:le(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:d,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},fe=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},ve=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),s=!1;if(!c)for(var d=0,l=a.children;d<l.length;d++){var u=l[d];if(ve([u],n,t,r),!1===t[u.accessor]){s=!0;break}}(c||s)&&(t[a.accessor]=!1)}}},me=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},ge=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(ge(e.children,n),me(e.children,n)&&(n[e.accessor]=!0))}))},pe=function(r){var o=r.allHeaders,i=r.depth,a=void 0===i?0:i,c=r.header,s=r.hiddenColumns,l=r.setHiddenColumns,u=n.useState(!0),h=u[0],f=u[1],v=d(),m=v.expandIcon,g=v.collapseIcon,p=v.headersRef,w=v.setMainBodyWidth,x=v.setPinnedLeftWidth,C=v.setPinnedRightWidth,I="".concat(16*a,"px"),y=c.children&&c.children.length>0,b=s[c.accessor]||y&&c.children&&me(c.children,s);return e.jsxs(e.Fragment,{children:[e.jsxs("div",t({className:"st-header-checkbox-item",style:{paddingLeft:I}},{children:[e.jsx("div",t({className:"st-header-icon-container"},{children:y?e.jsx("div",t({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?g:m})):null})),e.jsx(fe,t({checked:b,onChange:function(e){var n=t({},s);(n[c.accessor]=e,e)?ge(o,n):(ve(o,c.accessor,n),y&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===s[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,ve(o,c.children[0].accessor,n)));l(n),p.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=X(e).reduce((function(e,n){return e+G(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var s=K(i),d=K(a);r(s),o(d),t(c)}({headers:p.current,setMainBodyWidth:w,setPinnedLeftWidth:x,setPinnedRightWidth:C})}},{children:c.label}))]})),y&&h&&c.children&&e.jsx("div",t({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e.jsx(pe,{allHeaders:o,depth:a+1,header:n,hiddenColumns:s,setHiddenColumns:l},"".concat(n.accessor,"-").concat(t))}))}))]})},we=function(n){var r=n.headers,o=n.open,i=n.position,a=n.setHiddenColumns,c=n.hiddenColumns,s="left"===i?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(s),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,t){return e.jsx(pe,{header:n,hiddenColumns:c,setHiddenColumns:a,allHeaders:r},"".concat(n.accessor,"-").concat(t))}))}))}))},xe=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,c=r.headers,s=r.hiddenColumns,d=r.position,l=void 0===d?"right":d,u=r.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",t({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(we,{headers:c,open:f,position:l,setHiddenColumns:u,hiddenColumns:s})]})):null},Ce=function(r){var o=r.allowAnimations,i=void 0!==o&&o,c=r.cellUpdateFlash,d=void 0!==c&&c,m=r.collapseIcon,g=void 0===m?e.jsx(v,{className:"st-sort-icon"}):m,p=r.columnEditorPosition,w=void 0===p?"right":p,C=r.columnEditorText,I=void 0===C?"Columns":C,y=r.columnReordering,b=void 0!==y&&y,R=r.columnResizing,M=void 0!==R&&R,S=r.defaultHeaders,E=r.editColumns,j=void 0!==E&&E,k=r.editColumnsInitOpen,D=void 0!==k&&k,W=r.expandIcon,N=void 0===W?e.jsx(h,{className:"st-sort-icon"}):W,H=r.height,L=r.hideFooter,T=void 0!==L&&L,B=r.nextIcon,O=void 0===B?e.jsx(h,{className:"st-next-prev-icon"}):B,P=r.onCellEdit,F=r.onColumnOrderChange,A=r.onGridReady,U=r.onNextPage,z=r.prevIcon,Y=void 0===z?e.jsx(u,{className:"st-next-prev-icon"}):z,q=r.rowHeight,J=void 0===q?40:q,V=r.rows,K=r.rowsPerPage,X=void 0===K?10:K,G=r.selectableCells,_=void 0!==G&&G,$=r.selectableColumns,Q=void 0!==$&&$,Z=r.shouldPaginate,ee=void 0!==Z&&Z,ne=r.sortDownIcon,te=void 0===ne?e.jsx(v,{className:"st-sort-icon"}):ne,re=r.sortUpIcon,oe=void 0===re?e.jsx(f,{className:"st-sort-icon"}):re,ie=r.tableRef,se=r.theme,de=void 0===se?"light":se,le=n.useRef(null),ue=n.useRef(S),fe=n.useRef(null),ve=n.useRef(null),me=n.useRef(null),ge=n.useRef(null),pe=n.useRef(null),we=n.useState(1),Ce=we[0],Ie=we[1],ye=n.useState(!1),be=ye[0],Re=ye[1],Me=n.useState(0),Se=Me[0],Ee=Me[1],je=n.useState(0),ke=je[0],De=je[1],We=n.useState(0),Ne=We[0],He=We[1],Le=n.useState(0),Te=Le[0],Be=Le[1],Oe=n.useState(0),Pe=Oe[0],Fe=Oe[1],Ae=he({headers:ue.current,tableRows:V}),Ue=Ae.sort,ze=Ae.sortedRows,Ye=Ae.hiddenColumns,qe=Ae.setHiddenColumns,Je=Ae.updateSort;n.useEffect((function(){null==A||A()}),[A]);var Ve=n.useMemo((function(){if(!ee)return ze;var e=(Ce-1)*X,n=e+X;return ze.slice(e,n)}),[Ce,X,ee,ze]),Ke=n.useState(Ve),Xe=Ke[0],Ge=Ke[1];n.useEffect((function(){Ge(Ve)}),[Ve]);var _e=n.useMemo((function(){var e;if(!H)return window.innerHeight-J;var n=document.querySelector(".simple-table-root"),t=0;if(H.endsWith("px"))t=parseInt(H,10);else if(H.endsWith("vh")){var r=parseInt(H,10);t=window.innerHeight*r/100}else if(H.endsWith("%")){var o=parseInt(H,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-J)}),[H,J]),$e=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],s=0,d=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=s*a;if(h>=l)break;h+a>d&&c.push({row:i,depth:n,position:s,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),s+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:_e,flattenedRows:Xe,rowHeight:J,scrollTop:Te})}),[_e,J,Xe,Te]),Qe=n.useReducer((function(e){return e+1}),0)[1],Ze=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),c=i[0],s=i[1],d=n.useState(new Set),l=d[0],u=d[1],h=n.useState(null),f=h[0],v=h[1],m=n.useState(null),g=m[0],p=m[1],w=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(c).reduce((function(e,n){var t=n.split("-").map(Number),i=t[0],a=t[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");c.size>0&&navigator.clipboard.writeText(n)}),[r,c,o]),I=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),c=Math.min(e.colIndex,n.colIndex),d=Math.max(e.colIndex,n.colIndex),l=r;l<=i;l++)for(var h=c;h<=d;h++)if(l>=0&&l<o.length){var f=o[l].row.rowMeta.rowId;t.add(a({colIndex:h,rowIndex:l,rowId:f}))}u(new Set),v(null),s(t)}),[o,u,v,s]),y=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=a(e);u(new Set),v(null),s(new Set([n])),p(e)}}),[r.length,o.length,u,v,s,p]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),s(new Set),p(null),u((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&v(e[e.length-1])}),[s,p,u,v]);n.useEffect((function(){var e=function(e){if(t&&g){var n=g.rowIndex,i=g.colIndex,a=g.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var c=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===c)return;n=c}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var d={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};y(d)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(d={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},y(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(d={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},y(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(d={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},y(d))):"Escape"===e.key&&(s(new Set),u(new Set),v(null),x.current=null,p(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,r.length,g,I,y,t,o]);var R=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=a({colIndex:n,rowIndex:t,rowId:r}),i=c.has(o),s=l.has(n);return i||s}),[c,l]),M=n.useCallback((function(e){var n,t,r,i,a,c,s=e.colIndex,d=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[d-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:s,rowIndex:d+1,rowId:null===(c=null===(a=null===(i=o[d+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:s-1,rowIndex:d,rowId:u},g={colIndex:s+1,rowIndex:d,rowId:u};return(!R({colIndex:s,rowIndex:d-1,rowId:f})||l.has(s)&&0===d)&&h.push("st-selected-top-border"),(!R(v)||l.has(s)&&d===o.length-1)&&h.push("st-selected-bottom-border"),R(m)||h.push("st-selected-left-border"),R(g)||h.push("st-selected-right-border"),h.join(" ")}),[R,o,l]),S=n.useMemo((function(){return g?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===g.rowIndex&&t===g.colIndex&&r===g.rowId}:function(){return!1}}),[g]);return{getBorderClass:M,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){w.current=!0,x.current={rowIndex:r,colIndex:n,rowId:o},u(new Set),v(null);var i=a({colIndex:n,rowIndex:r,rowId:o});s(new Set([i])),p({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&w.current&&x.current){for(var i=new Set,c=Math.min(x.current.rowIndex,r),d=Math.max(x.current.rowIndex,r),l=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),h=c;h<=d;h++)for(var f=l;f<=u;f++)if(h>=0&&h<o.length){var v=o[h].row.rowMeta.rowId;i.add(a({colIndex:f,rowIndex:h,rowId:v}))}s(i)}},handleMouseUp:function(){w.current=!1},isInitialFocusedCell:S,isSelected:R,lastSelectedColumnIndex:f,selectColumns:b,selectedCells:c,selectedColumns:l,setInitialFocusedCell:p,setSelectedCells:s,setSelectedColumns:u}}({selectableCells:_,headers:ue.current,visibleRows:$e}),en=Ze.getBorderClass,nn=Ze.handleMouseDown,tn=Ze.handleMouseOver,rn=Ze.handleMouseUp,on=Ze.isInitialFocusedCell,an=Ze.isSelected,cn=Ze.selectColumns,sn=Ze.selectedCells,dn=Ze.selectedColumns,ln=Ze.setInitialFocusedCell,un=Ze.setSelectedCells,hn=Ze.setSelectedColumns,fn=n.useCallback((function(e,n){Je(e,n)}),[Je]),vn=n.useCallback((function(e){ue.current=e,Qe()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(sn.size>0&&un(new Set),dn.size>0&&hn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,sn,dn,un,hn]),n.useLayoutEffect((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Qe(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var mn=n.useRef(new Map);return n.useEffect((function(){ie&&(ie.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,s=null===(t=null===(n=null==V?void 0:V[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==s){var d=x({rowId:s,accessor:i}),l=mn.current.get(d);l&&l.updateContent(c),void 0!==(null===(o=null===(r=null==V?void 0:V[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(V[a].rowData[i]=c)}}})}),[ie,V]),e.jsx(s,t({value:{allowAnimations:i,cellRegistry:mn.current,cellUpdateFlash:d,collapseIcon:g,columnReordering:b,columnResizing:M,draggedHeaderRef:le,editColumns:j,expandIcon:N,forceUpdate:Qe,getBorderClass:en,handleMouseDown:nn,handleMouseOver:tn,headersRef:ue,hiddenColumns:Ye,hoveredHeaderRef:fe,isInitialFocusedCell:on,isSelected:an,mainBodyRef:ve,nextIcon:O,onCellEdit:P,onColumnOrderChange:F,onSort:fn,onTableHeaderDragEnd:vn,pinnedLeftRef:me,pinnedRightRef:ge,prevIcon:Y,rowHeight:J,scrollbarWidth:Pe,selectColumns:cn,selectableColumns:Q,setInitialFocusedCell:ln,setIsWidthDragging:Re,setMainBodyWidth:Ee,setPinnedLeftWidth:De,setPinnedRightWidth:He,setSelectedCells:un,setSelectedColumns:hn,shouldPaginate:ee,sortDownIcon:te,sortUpIcon:oe,tableBodyContainerRef:pe}},{children:e.jsx("div",t({className:"simple-table-root st-wrapper theme-".concat(de),style:H?{height:H}:{}},{children:e.jsxs("div",t({className:"st-wrapper-container"},{children:[e.jsxs("div",t({className:"st-content-wrapper",onMouseUp:rn,onMouseLeave:rn},{children:[e.jsx(ae,{flattenedRows:Xe,isWidthDragging:be,pinnedLeftWidth:ke,pinnedRightWidth:Ne,setFlattenedRows:Ge,setScrollTop:Be,sort:Ue,visibleRows:$e}),e.jsx(xe,{columnEditorText:I,editColumns:j,editColumnsInitOpen:D,headers:ue.current,hiddenColumns:Ye,position:w,setHiddenColumns:qe})]})),e.jsx(ce,{mainBodyRef:ve,mainBodyWidth:Se,pinnedLeftWidth:ke,pinnedRightWidth:Ne,setMainBodyWidth:Ee,tableBodyContainerRef:pe}),e.jsx(l,{currentPage:Ce,hideFooter:T,onPageChange:Ie,onNextPage:U,shouldPaginate:ee,totalPages:Math.ceil(V.length/X)})]}))}))}))};exports.SimpleTable=function(r){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(Ce,t({},r)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=function(){return t=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},t.apply(this,arguments)};function r(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((r=r.apply(e,n||[])).next())}))}function o(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=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(e,i)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}function i(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 a=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},c=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},s=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},d=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return d(e)})):[e]},l=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(a({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},u=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(a({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){u(e)}))},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},f=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},v=n.createContext(void 0),m=function(n){var r=n.children,o=n.value;return e.jsx(v.Provider,t({value:o},{children:r}))},g=function(){var e=n.useContext(v);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},p=function(i){var a=i.currentPage,c=i.hideFooter,s=i.onPageChange,d=i.onNextPage,l=i.shouldPaginate,u=i.totalPages,h=g(),f=h.nextIcon,v=h.prevIcon,m=n.useState(!0),p=m[0],w=m[1],x=!(a>1),C=!(a<u)&&!d||!p&&a===u;if(c||!l)return null;var y=function(){if(u<=15)return Array.from({length:u},(function(e,n){return n+1}));var e,n,t=[],r=15;if(a<=Math.ceil(7.5))e=1,n=14;else if(a>=u-Math.floor(7.5))e=Math.max(1,u-r+1),n=u;else{var o=Math.floor(7);e=a-o,n=a+(r-o-1)}for(var i=e;i<=n;i++)t.push(i);return n<u-1&&(t.push(-1),t.push(u)),t}();return e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){var e=a-1;e>=1&&s(e)},disabled:x},{children:v})),e.jsx("button",t({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return r(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(t){switch(t.label){case 0:return e=a===u,n=a+1,d&&e?[4,d(a)]:[3,2];case 1:if(!t.sent())return w(!1),[2];t.label=2;case 2:return(n<=u||d)&&s(n),[2]}}))}))},disabled:C},{children:f})),y.map((function(n,r){return n<0?e.jsx("span",t({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",t({onClick:function(){return function(e){e>=1&&e<=u&&s(e)}(n)},className:"st-page-btn ".concat(a===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},w=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},x=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},C=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},y=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},I=function(e){return e.position*(e.rowHeight+1)-1},b=function(e){return e.position*(e.rowHeight+1)},R=function(r){var o=r.children,i=r.onClose,a=r.open,c=r.setOpen,s=r.width,d=r.containerRef,l=g(),u=null==l?void 0:l.mainBodyRef,h=n.useRef(null),f=n.useRef(null),v=n.useState("bottom-left"),m=v[0],p=v[1],w=n.useState({}),x=w[0],C=w[1],y=n.useState(!1),I=y[0],b=y[1];return n.useEffect((function(){a&&h.current?(b(!1),!f.current&&h.current.parentElement&&(f.current=h.current.parentElement),requestAnimationFrame((function(){if(h.current&&f.current){var e,n=h.current,t=f.current.getBoundingClientRect(),r=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==u?void 0:u.current)?u.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,c="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(c="top");var v="left";o>e.right-t.right+t.width&&(v="right"),"bottom"===c?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===v?l.left=t.left:l.right=window.innerWidth-t.right,p("".concat(c,"-").concat(v)),C(l),b(!0)}}))):a||b(!1)}),[a,s,d,u]),n.useEffect((function(){var e=function(e){if(a&&h.current){var n=e.target;h.current&&!h.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,i,c]),n.useEffect((function(){var e=function(e){h.current&&!h.current.contains(e.target)&&(c(!1),null==i||i())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[i,a,c]),n.useEffect((function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[i,a,c]),a?e.jsx("div",t({ref:h,className:"st-dropdown-content st-dropdown-".concat(m),style:t({width:s?"".concat(s,"px"):"auto",visibility:I?"visible":"hidden"},x)},{children:o})):null},M=function(n){var r=n.children,o=n.onClick,i=n.isSelected,a=void 0!==i&&i,c=n.disabled,s=void 0!==c&&c,d=n.className,l=void 0===d?"":d;return e.jsx("div",t({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(s?"disabled":""," ").concat(l),onClick:function(){!s&&o&&o()},role:"option","aria-selected":a,"aria-disabled":s},{children:r}))},E=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.setOpen,s=r.value,d=n.useState(s),l=d[0],u=d[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(e){u(e),i(e),c(!1),o()};return e.jsxs(R,t({open:a,onClose:function(){o()},setOpen:c,width:120},{children:[e.jsx(M,t({isSelected:!0===l,onClick:function(){return h(!0)}},{children:"True"})),e.jsx(M,t({isSelected:!1===l,onClick:function(){return h(!1)}},{children:"False"}))]}))},S=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},j=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},k=function(r){var o,i,a=r.value,c=r.onChange,s=r.onClose,d=g(),l=d.nextIcon,u=d.prevIcon,h=n.useState(a||new Date),f=h[0],v=h[1],m=n.useState("days"),p=m[0],w=m[1],x=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",t({className:"st-datepicker"},{children:[e.jsxs("div",t({className:"st-datepicker-header"},{children:["days"===p&&e.jsxs(e.Fragment,{children:[e.jsx("button",t({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),e.jsxs("div",t({className:"st-datepicker-header-label",onClick:function(){return w("months")}},{children:[(i=f,i.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),e.jsx("button",t({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:l}))]}),"months"===p&&e.jsx("div",t({className:"st-datepicker-header-label",onClick:function(){return w("years")}},{children:f.getFullYear()})),"years"===p&&e.jsx("div",t({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",t({className:"st-datepicker-grid st-datepicker-".concat(p,"-grid")},{children:["days"===p&&function(){var n=[],r=f.getFullYear(),o=f.getMonth(),i=x(r,o),d=function(e,n){return new Date(e,n,1).getDay()}(r,o),l=x(r,o-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach((function(r,o){n.push(e.jsx("div",t({className:"st-datepicker-weekday"},{children:r}),"header-".concat(o)))}));for(var u=function(r){var o=l-d+r+1;n.push(e.jsx("div",t({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e);v(n),c(n),null==s||s()}(o)}},{children:o}),"prev-".concat(o)))},h=0;h<d;h++)u(h);for(var m=function(i){var d=i===(new Date).getDate()&&o===(new Date).getMonth()&&r===(new Date).getFullYear(),l=i===new Date(a).getDate()&&o===new Date(a).getMonth()&&r===new Date(a).getFullYear();n.push(e.jsx("div",t({className:"st-datepicker-day ".concat(d?"today":""," ").concat(l?"selected":""),onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth(),e);v(n),c(n),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)m(g);var p=35-(d+i),w=function(r){n.push(e.jsx("div",t({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e);v(n),c(n),null==s||s()}(r)}},{children:r}),"next-".concat(r)))};for(g=1;g<=p;g++)w(g);return n}(),"months"===p&&(o=[],Array.from({length:12},(function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})})).forEach((function(n,r){var i=r===f.getMonth();o.push(e.jsx("div",t({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),w("days")}(r)}},{children:n}),"month-".concat(r)))})),o),"years"===p&&function(){for(var n=[],r=f.getFullYear(),o=r-6,i=function(o){var i=o===r;n.push(e.jsx("div",t({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),w("months")}(o)}},{children:o}),"year-".concat(o)))},a=o;a<o+12;a++)i(a);return n}()]})),e.jsx("div",t({className:"st-datepicker-footer"},{children:e.jsx("button",t({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),c(e),null==s||s()}},{children:"Today"}))}))]}))},D=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.setOpen,s=r.value,d=n.useState(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(s)),l=d[0],u=d[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){o()};return e.jsx(R,t({open:a,onClose:h,setOpen:c,width:280},{children:e.jsx(k,{value:l,onChange:function(e){u(e),i(e.toISOString()),c(!1),o()},onClose:h})}))},W=function(r){var o=r.onBlur,i=r.onChange,a=r.open,c=r.options,s=r.setOpen,d=r.value,l=n.useState(d||""),u=l[0],h=l[1];n.useEffect((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);return e.jsx(R,t({open:a,onClose:function(){o()},setOpen:s,width:150},{children:e.jsx("div",t({className:"st-enum-dropdown-content"},{children:c.map((function(n){return e.jsx(M,t({isSelected:u===n,onClick:function(){return h(e=n),i(e),s(!1),void o();var e}},{children:n}),n)}))}))}))},N=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,c=void 0===a?"string":a,s=n.value,d=function(){i(!1)};if("boolean"===c&&"boolean"==typeof s)return e.jsx(E,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:s});if("date"===c){var l="string"==typeof s?s:"";return e.jsx(D,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l})}if("enum"===c){var u="string"==typeof s?s:"";return e.jsx(W,{onBlur:d,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:u})}if("number"===c&&"number"==typeof s)return e.jsx(j,{defaultValue:s,onBlur:d,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var h=null==s?"":String(s);return e.jsx(S,{defaultValue:h,onBlur:d,onChange:function(e){return o(e)}})},H=0,L=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===H||o-H>=r)&&(H=o,n(t))}},T=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(T);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=T(e[t]));return n},B=Date.now(),O={screenX:0,screenY:0},P=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 i(i([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=P(o.children,n,i(i([],t,!0),[r],!1));if(a)return a}}return null};var F=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,d=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,B=Date.now()},handleDragOver:function(e){var n,t,r=e.event,c=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-O.screenX,2)+Math.pow(h-O.screenY,2));a.current=c;var v=i.current,m=P(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),g=P(v,c.accessor);if(m&&g){var p=m.length,w=g.length,x=g;if(p!==w){var C=w-p;C>0&&(x=g.slice(0,-C))}var y=function(e,n,t){var r=T(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 c=i(r,n);return a(r,n,i(r,t)),a(r,t,c),{newHeaders:r,emergencyBreak:o}}(v,m,x),I=y.newHeaders,b=y.emergencyBreak;if(!(l||c.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===m.length||0===x.length||JSON.stringify(I)===JSON.stringify(i.current)||b)){var R=Date.now();JSON.stringify(I)===JSON.stringify(d)&&(R-B<1500||f<40)||(B=R,O={screenX:u,screenY:h},s(I))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==c||c(i.current)}}},A=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},z=n.forwardRef((function(r,o){var i,c,d=r.borderClass,l=r.colIndex,u=r.header,h=r.isHighlighted,f=r.isInitialFocused,v=r.onExpandRowClick,m=r.rowIndex,p=r.visibleRow,w=g(),x=w.cellRegistry,C=w.cellUpdateFlash,y=w.collapseIcon,I=w.draggedHeaderRef,b=w.expandIcon,R=w.handleMouseDown,M=w.handleMouseOver,E=w.headersRef,S=w.hoveredHeaderRef,j=w.onCellEdit,k=w.onTableHeaderDragEnd,D=p.depth,W=p.row,H=n.useState(W.rowData[u.accessor]),T=H[0],B=H[1],O=n.useState(!1),P=O[0],z=O[1],U=n.useState(!1),Y=U[0],q=U[1],J=n.useRef(null),V=F({draggedHeaderRef:I,headersRef:E,hoveredHeaderRef:S,onTableHeaderDragEnd:k}).handleDragOver,K=L(),X="cell-".concat(m,"-").concat(l),G=s({rowId:W.rowMeta.rowId,accessor:u.accessor});n.useEffect((function(){if(x){var e="".concat(W.rowMeta.rowId,"-").concat(u.accessor);return x.set(e,{updateContent:function(e){T!==e?(B(e),C&&(q(!0),J.current&&clearTimeout(J.current),J.current=setTimeout((function(){q(!1)}),800))):B(e)}}),function(){x.delete(e),J.current&&clearTimeout(J.current)}}}),[x,C,W.rowMeta.rowId,u.accessor,T]),n.useEffect((function(){if(Y){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[Y]),n.useEffect((function(){B(W.rowData[u.accessor])}),[W.rowData,u.accessor]),n.useEffect((function(){h||z(!1)}),[h]);var _="boolean"===u.type||"date"===u.type||"enum"===u.type,$=Boolean(null===(c=null===(i=W.rowMeta)||void 0===i?void 0:i.children)||void 0===c?void 0:c.length),Q=Boolean(null==u?void 0:u.isEditable),Z="st-cell ".concat(D>0&&u.expandable?"st-cell-depth-".concat(D):""," ").concat(h?f?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(Q?"clickable":""," ").concat(Y?"st-cell-updating":""),ee=n.useCallback((function(e){B(e),null==j||j({accessor:u.accessor,newValue:e,row:W})}),[u.accessor,j,W]);return P&&!_?e.jsx("div",t({className:"st-cell-editing",id:a({accessor:u.accessor,rowIndex:m+1})},{children:e.jsx(N,{enumOptions:u.enumOptions,onChange:ee,setIsEditing:z,type:u.type,value:T})})):e.jsxs("div",t({className:Z,id:X,onDoubleClick:function(){return u.isEditable&&z(!0)},onMouseDown:function(){return R({rowIndex:m,colIndex:l,rowId:W.rowMeta.rowId})},onMouseOver:function(){return M({rowIndex:m,colIndex:l,rowId:W.rowMeta.rowId})},onDragOver:function(e){return K({callback:V,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||P||(e.preventDefault(),z(!0))},ref:o,"data-row-index":m,"data-col-index":l,"data-row-id":W.rowMeta.rowId,"data-accessor":u.accessor},{children:[u.expandable&&$?W.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return v(W.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return v(W.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):null,e.jsx("span",t({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:l,row:W}):A({content:T,header:u})})})),P&&_&&e.jsx(N,{enumOptions:u.enumOptions,onChange:ee,setIsEditing:z,type:u.type,value:T})]}),G)})),U=function(n){var r=n.children,o=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"]);return g().allowAnimations?e.jsx(Y,t({},o,{children:r})):e.jsx(e.Fragment,{children:r})},Y=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,c=t.rowIndex,s=n.useRef(!1),d=g(),l=d.draggedHeaderRef,u=d.headersRef,h=d.mainBodyRef,f=d.shouldPaginate,v=n.useState({}),m=v[0],p=v[1],w=n.useRef({}),x=u.current;return n.useLayoutEffect((function(){if(x){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(a({accessor:e.accessor,rowIndex:r}));if(i){var c=i.getAnimations().some((function(e){return"running"===e.playState})),s=i.getBoundingClientRect();c&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=s}}})),o}({currentHeaders:x,draggedHeaderRef:l,rowIndex:c});JSON.stringify(e)!==JSON.stringify(m)&&(w.current=m,p(e))}}),[m,x,l,o,c]),n.useLayoutEffect((function(){var e=h.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[l,h]),n.useEffect((function(){i||s.current||Object.keys(w.current).length&&x&&x.forEach((function(e){var n=document.getElementById(a({accessor:e.accessor,rowIndex:c}));if(n){var t=w.current[e.accessor],r=m[e.accessor];if(t&&r){var o=t.left-r.left,i=f?0:t.top-r.top,s=Math.abs(o),d=Math.abs(i);(s>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[m,x,o,i,w,c,f]),e.jsx(e.Fragment,{children:r})},q=function(n){var r=n.columnIndices,o=n.headers,i=n.hiddenColumns,s=n.isWidthDragging,d=n.onExpandRowClick,l=n.pinned,u=n.rowIndex,h=n.rowIndices,f=n.visibleRow,v=o.filter((function(e){return c({hiddenColumns:i,header:e,pinned:l})}));return e.jsx(U,t({isBody:!0,pauseAnimation:s,rowIndex:u+1},{children:v.map((function(n){return e.jsx(J,{columnIndices:r,header:n,headers:o,hiddenColumns:i,onExpandRowClick:d,pinned:l,rowIndex:u,rowIndices:h,visibleRow:f},a({accessor:n.accessor,rowIndex:u+1}))}))}))},J=function(t){var r=t.columnIndices,o=t.header,i=t.headers,s=t.hiddenColumns,d=t.onExpandRowClick,l=t.pinned,u=t.rowIndex,h=t.rowIndices,f=t.visibleRow,v=r[o.accessor],m=g(),p=m.getBorderClass,w=m.isSelected,x=m.isInitialFocusedCell;if(o.children){var C=o.children.filter((function(e){return c({hiddenColumns:s,header:e,pinned:l})}));return e.jsx(n.Fragment,{children:C.map((function(n){return e.jsx(J,{columnIndices:r,header:n,headers:i,hiddenColumns:s,onExpandRowClick:d,pinned:l,rowIndex:u,rowIndices:h,visibleRow:f},a({accessor:n.accessor,rowIndex:u+1}))}))})}var y={rowIndex:u,colIndex:v,rowId:f.row.rowMeta.rowId},I=p(y),b=w(y),R=x(y);return e.jsx(z,{borderClass:I,colIndex:v,header:o,isHighlighted:b,isInitialFocused:R,onExpandRowClick:d,rowIndex:u,visibleRow:f},a({accessor:o.accessor,rowIndex:u+1}))},V=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,c=n.index,s=n.isWidthDragging,d=n.onExpandRowClick,l=n.pinned,u=n.rowHeight,h=n.rowIndices,f=n.visibleRow,v=f.position,m=v%2==0;return e.jsx("div",t({className:"st-row ".concat(m?"even":"odd"),style:{gridTemplateColumns:o,top:b({position:v,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(q,{columnIndices:r,headers:i,hiddenColumns:a,isWidthDragging:s,onExpandRowClick:d,pinned:l,rowIndex:c,rowIndices:h,visibleRow:f},c)}))},K=function(n){var r=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",t({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:I({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},X=function(r){var o=r.columnIndices,i=r.headers,a=r.hiddenColumns,c=r.isWidthDragging,s=r.onExpandRowClick,d=r.pinned,l=r.ref,u=r.rowHeight,h=r.rowIndices,f=r.templateColumns,v=r.totalHeight,m=r.visibleRows,g=r.width,p=d?"st-body-pinned-".concat(d):"st-body-main";return e.jsx("div",t({className:p,ref:l,style:t({position:"relative",height:"".concat(v,"px"),width:g},!d&&{flexGrow:1})},{children:m.map((function(t,r){var l,v,g=m[r-1],p=Boolean((null==g?void 0:g.depth)!==(null==t?void 0:t.depth)&&(null===(v=null===(l=null==t?void 0:t.row.rowMeta)||void 0===l?void 0:l.children)||void 0===v?void 0:v.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(K,{displayStrongBorder:p,position:t.position,rowHeight:u,templateColumns:f}),e.jsx(V,{columnIndices:o,gridTemplateColumns:f,headers:i,hiddenColumns:a,index:r,isWidthDragging:c,onExpandRowClick:s,pinned:d,rowHeight:u,rowIndices:h,visibleRow:t})]},t.position)}))}))};function G(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,s=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return c({hiddenColumns:t,header:e})})).forEach((function(e,n){s(e,0===n)}))};return r.forEach((function(e,n){s(e,0===n)})),n.current.filter((function(e){return!e.pinned&&c({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;s(e,t)})),o.forEach((function(e){s(e,!1)})),i}var _=function(r){var o=r.flattenedRows,i=r.headerContainerRef,a=r.isWidthDragging,c=r.mainTemplateColumns,s=r.pinnedLeftColumns,d=r.pinnedLeftTemplateColumns,l=r.pinnedLeftWidth,u=r.pinnedRightColumns,h=r.pinnedRightTemplateColumns,f=r.pinnedRightWidth,v=r.setFlattenedRows,m=r.setScrollTop,p=r.visibleRows,w=g(),x=w.headersRef,C=w.hiddenColumns,y=w.mainBodyRef,I=w.rowHeight,b=w.scrollbarWidth,R=w.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],c=i[1];n.useEffect((function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:R,scrollbarWidth:b});var M,E,S=n.useRef(null),j=(M=0,(E=function(e){e.forEach((function(e){M+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&E(e.rowMeta.children)}))})(o),M)*(I+1)-1,k=n.useMemo((function(){return G({headersRef:x,hiddenColumns:C,pinnedLeftColumns:s,pinnedRightColumns:u})}),[x,C,s,u]),D=n.useMemo((function(){var e={};return p.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[p]),W=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};v((function(e){return e.map(n)}))},N={headerContainerRef:i,headers:x.current,hiddenColumns:C,isWidthDragging:a,rowHeight:I,visibleRows:p,columnIndices:k,rowIndices:D};return e.jsxs("div",t({className:"st-body-container",ref:R,onScroll:function(e){var n=e.currentTarget.scrollTop;S.current&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame((function(){m(n)}))}},{children:[s.length>0&&e.jsx(X,t({},N,{onExpandRowClick:W,pinned:"left",templateColumns:d,totalHeight:j,width:l})),e.jsx(X,t({},N,{ref:y,onExpandRowClick:W,templateColumns:c,totalHeight:j})),u.length>0&&e.jsx(X,t({},N,{onExpandRowClick:W,pinned:"right",templateColumns:h,totalHeight:j,width:f}))]}))},$=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},Q=function(e){return void 0===e&&(e=0),e?e+1:0},Z=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,c=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:d(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=l(e))})))})),n.pinned?Q(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(c):"right"===n.pinned?a(c):n.pinned||o(c)},ee=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,c=e.setIsWidthDragging,s=e.setMainBodyWidth,l=e.setPinnedLeftWidth,f=e.setPinnedRightWidth,v=e.startWidth;c(!0),n.preventDefault();var m=n.clientX;if(i&&!i.hide){var g=h(i),p=r-o>1,w=p?d(i):[i],x=function(e){var n="right"===i.pinned?m-e.clientX:e.clientX-m;if(p&&w.length>1)ne({delta:n,header:i,headersRef:a,leafHeaders:w,minWidth:g,setMainBodyWidth:s,setPinnedLeftWidth:l,setPinnedRightWidth:f,startWidth:v});else{var r=Math.max(v+n,g);i.width=r,Z({header:i,headers:a.current,newWidth:r,setMainBodyWidth:s,setPinnedLeftWidth:l,setPinnedRightWidth:f})}a.current.forEach((function(e){u(e)})),t()},C=function(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C),c(!1)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",C)}},ne=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,c=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,d=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,h(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),f=Math.max(d+n,l);Z({header:t,headers:r.current,newWidth:f,setMainBodyWidth:a,setPinnedLeftWidth:c,setPinnedRightWidth:s});var v=f-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=v*(n/u),r=Math.max(n+t,i);e.width=r}))},te=n.forwardRef((function(r,o){var c,s,d=r.colIndex,l=r.forceHeadersUpdate,u=r.gridColumnEnd,h=r.gridColumnStart,f=r.gridRowEnd,v=r.gridRowStart,m=r.header,p=r.reverse,w=r.sort,x=g(),C=x.columnReordering,y=x.columnResizing,I=x.draggedHeaderRef,b=x.forceUpdate,R=x.headersRef,M=x.hoveredHeaderRef,E=x.onColumnOrderChange,S=x.onSort,j=x.onTableHeaderDragEnd,k=x.rowHeight,D=x.selectColumns,W=x.selectableColumns,N=x.setInitialFocusedCell,H=x.setIsWidthDragging,T=x.setMainBodyWidth,B=x.setPinnedLeftWidth,O=x.setPinnedRightWidth,P=x.setSelectedCells,A=x.setSelectedColumns,z=x.sortDownIcon,U=x.sortUpIcon,Y=Boolean(null==m?void 0:m.isSortable),q="st-header-cell ".concat(m.accessor===(null===(c=M.current)||void 0===c?void 0:c.accessor)?"st-hovered":""," ").concat((null===(s=I.current)||void 0===s?void 0:s.accessor)===m.accessor?"st-dragging":""," ").concat(Y?"clickable":""," ").concat(C&&!Y?"columnReordering":""," ").concat(m.children?"parent":""),J=F({draggedHeaderRef:I,headersRef:R,hoveredHeaderRef:M,onColumnOrderChange:E,onTableHeaderDragEnd:j}),V=J.handleDragStart,K=J.handleDragEnd,X=J.handleDragOver,G=L(),_=function(e){var n=e.event,t=e.header;if(W){var r=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 c=a[i];o=r(c,o)}return o};return r(e,n),t}(t,d);return n.shiftKey&&D?A((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],a=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<a&&(a=t,o=e)}));var c,s,d,l,u=i(i([],(c=o,s=n,d=Math.min(c,s),l=Math.max(c,s),Array.from({length:l-d+1},(function(e,n){return d+n}))),!0),r,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):D&&D(r),P(new Set),void N(null)}t.isSortable&&S(d,t.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!m)return null;var $=y&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;G({callback:ee,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:u,gridColumnStart:h,header:m,headersRef:R,setIsWidthDragging:H,setMainBodyWidth:T,setPinnedLeftWidth:B,setPinnedRightWidth:O,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Q=w&&w.key.accessor===m.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:m})}},{children:["ascending"===w.direction&&U&&U,"descending"===w.direction&&z&&z]}));return e.jsxs("div",t({className:q,id:a({accessor:m.accessor,rowIndex:0}),onDragOver:function(e){G({callback:X,callbackProps:{event:e,hoveredHeader:m},limit:50})},ref:o,style:t(t({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:u},u-h>1?{}:{width:m.width}),f-v>1?{}:{height:k})},{children:[p&&$,"right"===m.align&&Q,e.jsx("div",t({className:"st-header-label",draggable:C&&!m.disableReorder,onClick:function(e){return _({event:e,header:m})},onDragEnd:function(e){e.preventDefault(),K(),l()},onDragStart:function(e){C&&m&&function(e){V(e)}(m)}},{children:e.jsx("span",t({className:"st-header-label-text ".concat("right"===m.align?"right-aligned":"center"===m.align?"center-aligned":"left-aligned")},{children:null==m?void 0:m.label}))})),"right"!==m.align&&Q,!p&&$]}))})),re=function(r){var o=r.columnIndices,i=r.gridTemplateColumns,a=r.handleScroll,s=r.headersRef,d=r.hiddenColumns,l=r.maxDepth,u=r.pinned,h=r.sectionRef,f=r.sort,v=n.useReducer((function(e){return e+1}),0)[1],m=n.useMemo((function(){var e=[],n=1,t=function(r,i,a){var s,h;if(void 0===a&&(a=!1),!c({hiddenColumns:d,header:r,pinned:u}))return 0;a||n++;var f=null!==(h=null===(s=r.children)||void 0===s?void 0:s.filter((function(e){return c({hiddenColumns:d,header:e,pinned:u})})).length)&&void 0!==h?h:0,v=n,m=f>0?v+f:v+1,g=i,p=f>0?i+1:l+1;if(e.push({header:r,gridColumnStart:v,gridColumnEnd:m,gridRowStart:g,gridRowEnd:p,colIndex:o[r.accessor]}),r.children){var w=!0;r.children.forEach((function(e){c({hiddenColumns:d,header:e,pinned:u})&&(t(e,i+1,w),w=!1)}))}return m-v},r=s.current.filter((function(e){return c({hiddenColumns:d,header:e,pinned:u})})),i=!0;return r.forEach((function(e){t(e,1,i),i=!1})),e}),[s,d,l,u,o]);return e.jsx("div",t({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:h,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(U,t({rowIndex:0},{children:m.map((function(t){return e.jsx(te,{colIndex:t.colIndex,forceHeadersUpdate:v,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===u,sort:f},t.header.accessor)}))}))}))},oe=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(oe)):1},ie=function(r){var o=r.centerHeaderRef,i=r.headerContainerRef,a=r.headersRef,s=r.hiddenColumns,d=r.mainTemplateColumns,l=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightTemplateColumns,v=r.sort,m=g(),p=m.mainBodyRef,w=m.pinnedLeftRef,x=m.pinnedRightRef,C=m.setPinnedLeftWidth,y=m.setPinnedRightWidth;$(p,o);var I=n.useMemo((function(){return G({headersRef:a,hiddenColumns:s,pinnedLeftColumns:l,pinnedRightColumns:h})}),[a,s,l,h]),b=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(c({hiddenColumns:s,header:e})){var t=oe(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,s]).maxDepth;return n.useLayoutEffect((function(){var e,n;C(Q(null===(e=w.current)||void 0===e?void 0:e.clientWidth)),y(Q(null===(n=x.current)||void 0===n?void 0:n.clientWidth))}),[w,x,C,y]),e.jsxs("div",t({className:"st-header-container",ref:i},{children:[l.length>0&&e.jsx(re,{columnIndices:I,gridTemplateColumns:u,handleScroll:void 0,headersRef:a,hiddenColumns:s,maxDepth:b,pinned:"left",sectionRef:w,sort:v}),e.jsx(re,{columnIndices:I,gridTemplateColumns:d,handleScroll:function(e){var n,t,r=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=p.current)||void 0===t||t.scrollTo(r,0))},headersRef:a,hiddenColumns:s,maxDepth:b,sectionRef:o,sort:v}),h.length>0&&e.jsx(re,{columnIndices:I,gridTemplateColumns:f,handleScroll:void 0,headersRef:a,hiddenColumns:s,maxDepth:b,pinned:"right",sectionRef:x,sort:v})]}))},ae=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):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(" "))},ce=function(r){var o=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,c=r.pinnedRightWidth,s=r.setFlattenedRows,d=r.setScrollTop,l=r.sort,u=r.visibleRows,h=g(),f=h.columnResizing,v=h.editColumns,m=h.headersRef,p=h.hiddenColumns,w=n.useRef(null),x=n.useRef(null),C=m.current.filter((function(e){return!e.pinned})),y=m.current.filter((function(e){return"left"===e.pinned})),I=m.current.filter((function(e){return"right"===e.pinned})),b=n.useMemo((function(){return ae({headers:y,hiddenColumns:p})}),[y,p]),R=n.useMemo((function(){return ae({headers:C,hiddenColumns:p})}),[C,p]),M=n.useMemo((function(){return ae({headers:I,hiddenColumns:p})}),[I,p]),E={centerHeaderRef:x,headerContainerRef:w,headersRef:m,hiddenColumns:p,mainTemplateColumns:R,pinnedLeftColumns:y,pinnedLeftTemplateColumns:b,pinnedRightColumns:I,pinnedRightTemplateColumns:M,sort:l},S={flattenedRows:o,headerContainerRef:w,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:y,pinnedLeftTemplateColumns:b,pinnedLeftWidth:a,pinnedRightColumns:I,pinnedRightTemplateColumns:M,pinnedRightWidth:c,setFlattenedRows:s,setScrollTop:d,visibleRows:u};return e.jsxs("div",t({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(ie,t({},E)),e.jsx(_,t({},S))]}))},se=function(r){var o,i,a=r.mainBodyWidth,c=r.mainBodyRef,s=r.pinnedLeftWidth,d=r.pinnedRightWidth,l=r.setMainBodyWidth,u=r.tableBodyContainerRef,h=g().editColumns,f=n.useState(!1),v=f[0],m=f[1],p=n.useRef(null),w=u.current&&u.current.scrollHeight>u.current.clientHeight,x=h?28:0,C=(h?d+1:d)+(u.current&&w?u.current.offsetWidth-u.current.clientWidth:0);return $(c,p),n.useEffect((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.scrollWidth;l(e)}}()}),1)}),[c,l]),n.useEffect((function(){setTimeout((function(){!function(){if(c.current){var e=c.current.clientWidth;m(a>e)}}()}),1)}),[c,a,l]),v?e.jsxs("div",t({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(o=p.current)||void 0===o?void 0:o.offsetHeight}}),a>0&&e.jsx("div",t({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&c.current&&c.current.scrollTo({left:n,behavior:"auto"})},ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})})),d>0&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}})}),x>0&&e.jsx("div",{style:{width:x-1.5,height:"100%",flexShrink:0}})]})):null},de={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 de.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?de.string(e,n,t):"number"==typeof e&&"number"==typeof n?de.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?de.boolean(e,n,t):de.string(String(e),String(n),t)}},le=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 de.number(i,a,r)}return"date"===t?de.date(String(e),String(n),r):"boolean"===t?de.boolean(Boolean(e),Boolean(n),r):"enum"===t?de.enum(String(e),String(n),r):de.string(String(e),String(n),r)},ue=function(e,n,r){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",c=n.direction,s=new Map,d=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(s.size)).toString();l=r,d.set(l,e),s.has(l)||s.set(l,[])}else if(l){var o=s.get(l)||[];o.push(e),s.set(l,o)}else{var i="default";s.has(i)||s.set(i,[]),null===(t=s.get(i))||void 0===t||t.push(e)}}));var u=[];return s.forEach((function(e,o){if(d.has(o)){var s=d.get(o);s.rowMeta.children&&s.rowMeta.children.length>0&&(s.rowMeta.children=he(s.rowMeta.children,n,r)),u.push(s)}var l=i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return le(o,i,a,c)}));u.push.apply(u,l.map((function(e){var o=t({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=he(o.rowMeta.children,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o})))})),u},he=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",c=n.direction;return i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return le(o,i,a,c)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:he(e.rowMeta.children,n,r)})}):e}))},fe=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],c=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),s=n.useState(c),d=s[0],l=s[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:ue(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:d,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},ve=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},me=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var c=a.children.some((function(e){return e.accessor===n})),s=!1;if(!c)for(var d=0,l=a.children;d<l.length;d++){var u=l[d];if(me([u],n,t,r),!1===t[u.accessor]){s=!0;break}}(c||s)&&(t[a.accessor]=!1)}}},ge=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},pe=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(pe(e.children,n),ge(e.children,n)&&(n[e.accessor]=!0))}))},we=function(r){var o=r.allHeaders,i=r.depth,a=void 0===i?0:i,c=r.header,s=r.hiddenColumns,u=r.setHiddenColumns,h=n.useState(!0),f=h[0],v=h[1],m=g(),p=m.expandIcon,w=m.collapseIcon,x=m.headersRef,C=m.setMainBodyWidth,y=m.setPinnedLeftWidth,I=m.setPinnedRightWidth,b="".concat(16*a,"px"),R=c.children&&c.children.length>0,M=s[c.accessor]||R&&c.children&&ge(c.children,s);return e.jsxs(e.Fragment,{children:[e.jsxs("div",t({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[e.jsx("div",t({className:"st-header-icon-container"},{children:R?e.jsx("div",t({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),v(!f)}},{children:f?w:p})):null})),e.jsx(ve,t({checked:M,onChange:function(e){var n=t({},s);(n[c.accessor]=e,e)?pe(o,n):(me(o,c.accessor,n),R&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===s[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,me(o,c.children[0].accessor,n)));u(n),x.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,c=0;n.forEach((function(e){if(!e.hide){var n=d(e).reduce((function(e,n){return e+l(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:c+=n}}));var s=Q(i),u=Q(a);r(s),o(u),t(c)}({headers:x.current,setMainBodyWidth:C,setPinnedLeftWidth:y,setPinnedRightWidth:I})}},{children:c.label}))]})),R&&f&&c.children&&e.jsx("div",t({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e.jsx(we,{allHeaders:o,depth:a+1,header:n,hiddenColumns:s,setHiddenColumns:u},"".concat(n.accessor,"-").concat(t))}))}))]})},xe=function(n){var r=n.headers,o=n.open,i=n.position,a=n.setHiddenColumns,c=n.hiddenColumns,s="left"===i?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(s),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,t){return e.jsx(we,{header:n,hiddenColumns:c,setHiddenColumns:a,allHeaders:r},"".concat(n.accessor,"-").concat(t))}))}))}))},Ce=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,c=r.headers,s=r.hiddenColumns,d=r.position,l=void 0===d?"right":d,u=r.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",t({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(xe,{headers:c,open:f,position:l,setHiddenColumns:u,hiddenColumns:s})]})):null},ye=function(r){var o=r.allowAnimations,i=void 0!==o&&o,a=r.cellUpdateFlash,c=void 0!==a&&a,l=r.collapseIcon,u=void 0===l?e.jsx(y,{className:"st-sort-icon"}):l,h=r.columnEditorPosition,v=void 0===h?"right":h,g=r.columnEditorText,I=void 0===g?"Columns":g,b=r.columnReordering,R=void 0!==b&&b,M=r.columnResizing,E=void 0!==M&&M,S=r.defaultHeaders,j=r.editColumns,k=void 0!==j&&j,D=r.editColumnsInitOpen,W=void 0!==D&&D,N=r.expandIcon,H=void 0===N?e.jsx(x,{className:"st-sort-icon"}):N,L=r.height,T=r.hideFooter,B=void 0!==T&&T,O=r.nextIcon,P=void 0===O?e.jsx(x,{className:"st-next-prev-icon"}):O,F=r.onCellEdit,A=r.onColumnOrderChange,z=r.onGridReady,U=r.onNextPage,Y=r.prevIcon,q=void 0===Y?e.jsx(w,{className:"st-next-prev-icon"}):Y,J=r.rowHeight,V=void 0===J?40:J,K=r.rows,X=r.rowsPerPage,G=void 0===X?10:X,_=r.selectableCells,$=void 0!==_&&_,Q=r.selectableColumns,Z=void 0!==Q&&Q,ee=r.shouldPaginate,ne=void 0!==ee&&ee,te=r.sortDownIcon,re=void 0===te?e.jsx(y,{className:"st-sort-icon"}):te,oe=r.sortUpIcon,ie=void 0===oe?e.jsx(C,{className:"st-sort-icon"}):oe,ae=r.tableRef,de=r.theme,le=void 0===de?"light":de,ue=n.useRef(null),he=n.useRef(S),ve=n.useRef(null),me=n.useRef(null),ge=n.useRef(null),pe=n.useRef(null),we=n.useRef(null),xe=n.useState(1),ye=xe[0],Ie=xe[1],be=n.useState(!1),Re=be[0],Me=be[1],Ee=n.useState(0),Se=Ee[0],je=Ee[1],ke=n.useState(0),De=ke[0],We=ke[1],Ne=n.useState(0),He=Ne[0],Le=Ne[1],Te=n.useState(0),Be=Te[0],Oe=Te[1],Pe=n.useState(0),Fe=Pe[0],Ae=Pe[1],ze=fe({headers:he.current,tableRows:K}),Ue=ze.sort,Ye=ze.sortedRows,qe=ze.hiddenColumns,Je=ze.setHiddenColumns,Ve=ze.updateSort;n.useEffect((function(){null==z||z()}),[z]);var Ke=n.useMemo((function(){if(!ne)return Ye;var e=(ye-1)*G,n=e+G;return Ye.slice(e,n)}),[ye,G,ne,Ye]),Xe=n.useState(Ke),Ge=Xe[0],_e=Xe[1];n.useEffect((function(){_e(Ke)}),[Ke]);var $e=n.useMemo((function(){var e;if(!L)return window.innerHeight-V;var n=document.querySelector(".simple-table-root"),t=0;if(L.endsWith("px"))t=parseInt(L,10);else if(L.endsWith("vh")){var r=parseInt(L,10);t=window.innerHeight*r/100}else if(L.endsWith("%")){var o=parseInt(L,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-V)}),[L,V]),Qe=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,c=[],s=0,d=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=s*a;if(h>=l)break;h+a>d&&c.push({row:i,depth:n,position:s,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),s+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),c}({bufferRowCount:5,contentHeight:$e,flattenedRows:Ge,rowHeight:V,scrollTop:Be})}),[$e,V,Ge,Be]),Ze=n.useReducer((function(e){return e+1}),0)[1],en=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),a=i[0],c=i[1],s=n.useState(new Set),l=s[0],u=s[1],h=n.useState(null),v=h[0],m=h[1],g=n.useState(null),p=g[0],w=g[1],x=n.useRef(!1),C=n.useRef(null),y=n.useCallback((function(){var e=r.flatMap(d).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var t=Array.from(a).reduce((function(e,t){var r=t.split("-").map(Number),i=r[0],a=r[1];e[i]||(e[i]=[]);var c=n.get(a);return e[i][a]=c?o[i].row.rowData[c]:"",e}),{}),i=Object.values(t).map((function(e){return Object.values(e).join("\t")})).join("\n");a.size>0&&navigator.clipboard.writeText(i)}),[r,a,o]),I=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),d=r;d<=i;d++)for(var l=a;l<=s;l++)if(d>=0&&d<o.length){var h=o[d].row.rowMeta.rowId;t.add(f({colIndex:l,rowIndex:d,rowId:h}))}u(new Set),m(null),c(t)}),[o,u,m,c]),b=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=f(e);u(new Set),m(null),c(new Set([n])),w(e)}}),[r.length,o.length,u,m,c,w]),R=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),u((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&m(e[e.length-1])}),[c,w,u,m]);n.useEffect((function(){var e=function(e){if(t&&p){var n=p.rowIndex,i=p.colIndex,a=p.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var s=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===s)return;n=s}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var d={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};b(d)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(d={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},b(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(d={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},b(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(d={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},b(d))):"Escape"===e.key&&(c(new Set),u(new Set),m(null),C.current=null,w(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,p,I,b,t,o]);var M=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=f({colIndex:n,rowIndex:t,rowId:r}),i=a.has(o),c=l.has(n);return i||c}),[a,l]),E=n.useCallback((function(e){var n,t,r,i,a,c,s=e.colIndex,d=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[d-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:s,rowIndex:d+1,rowId:null===(c=null===(a=null===(i=o[d+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===c?void 0:c.rowId},m={colIndex:s-1,rowIndex:d,rowId:u},g={colIndex:s+1,rowIndex:d,rowId:u};return(!M({colIndex:s,rowIndex:d-1,rowId:f})||l.has(s)&&0===d)&&h.push("st-selected-top-border"),(!M(v)||l.has(s)&&d===o.length-1)&&h.push("st-selected-bottom-border"),M(m)||h.push("st-selected-left-border"),M(g)||h.push("st-selected-right-border"),h.join(" ")}),[M,o,l]),S=n.useMemo((function(){return p?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===p.rowIndex&&t===p.colIndex&&r===p.rowId}:function(){return!1}}),[p]);return{getBorderClass:E,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){x.current=!0,C.current={rowIndex:r,colIndex:n,rowId:o},u(new Set),m(null);var i=f({colIndex:n,rowIndex:r,rowId:o});c(new Set([i])),w({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&x.current&&C.current){for(var i=new Set,a=Math.min(C.current.rowIndex,r),s=Math.max(C.current.rowIndex,r),d=Math.min(C.current.colIndex,n),l=Math.max(C.current.colIndex,n),u=a;u<=s;u++)for(var h=d;h<=l;h++)if(u>=0&&u<o.length){var v=o[u].row.rowMeta.rowId;i.add(f({colIndex:h,rowIndex:u,rowId:v}))}c(i)}},handleMouseUp:function(){x.current=!1},isInitialFocusedCell:S,isSelected:M,lastSelectedColumnIndex:v,selectColumns:R,selectedCells:a,selectedColumns:l,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:u}}({selectableCells:$,headers:he.current,visibleRows:Qe}),nn=en.getBorderClass,tn=en.handleMouseDown,rn=en.handleMouseOver,on=en.handleMouseUp,an=en.isInitialFocusedCell,cn=en.isSelected,sn=en.selectColumns,dn=en.selectedCells,ln=en.selectedColumns,un=en.setInitialFocusedCell,hn=en.setSelectedCells,fn=en.setSelectedColumns,vn=n.useCallback((function(e,n){Ve(e,n)}),[Ve]),mn=n.useCallback((function(e){he.current=e,Ze()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Z&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(dn.size>0&&hn(new Set),ln.size>0&&fn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Z,dn,ln,hn,fn]),n.useLayoutEffect((function(){if(we.current){var e=we.current.offsetWidth-we.current.clientWidth;Ae(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Ze(),we.current){var e=we.current.offsetWidth-we.current.clientWidth;Ae(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var gn=n.useRef(new Map);return n.useEffect((function(){ae&&(ae.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,c=e.newValue,d=null===(t=null===(n=null==K?void 0:K[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==d){var l=s({rowId:d,accessor:i}),u=gn.current.get(l);u&&u.updateContent(c),void 0!==(null===(o=null===(r=null==K?void 0:K[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(K[a].rowData[i]=c)}}})}),[ae,K]),e.jsx(m,t({value:{allowAnimations:i,cellRegistry:gn.current,cellUpdateFlash:c,collapseIcon:u,columnReordering:R,columnResizing:E,draggedHeaderRef:ue,editColumns:k,expandIcon:H,forceUpdate:Ze,getBorderClass:nn,handleMouseDown:tn,handleMouseOver:rn,headersRef:he,hiddenColumns:qe,hoveredHeaderRef:ve,isInitialFocusedCell:an,isSelected:cn,mainBodyRef:me,nextIcon:P,onCellEdit:F,onColumnOrderChange:A,onSort:vn,onTableHeaderDragEnd:mn,pinnedLeftRef:ge,pinnedRightRef:pe,prevIcon:q,rowHeight:V,scrollbarWidth:Fe,selectColumns:sn,selectableColumns:Z,setInitialFocusedCell:un,setIsWidthDragging:Me,setMainBodyWidth:je,setPinnedLeftWidth:We,setPinnedRightWidth:Le,setSelectedCells:hn,setSelectedColumns:fn,shouldPaginate:ne,sortDownIcon:re,sortUpIcon:ie,tableBodyContainerRef:we}},{children:e.jsx("div",t({className:"simple-table-root st-wrapper theme-".concat(le),style:L?{height:L}:{}},{children:e.jsxs("div",t({className:"st-wrapper-container"},{children:[e.jsxs("div",t({className:"st-content-wrapper",onMouseUp:on,onMouseLeave:on},{children:[e.jsx(ce,{flattenedRows:Ge,isWidthDragging:Re,pinnedLeftWidth:De,pinnedRightWidth:He,setFlattenedRows:_e,setScrollTop:Oe,sort:Ue,visibleRows:Qe}),e.jsx(Ce,{columnEditorText:I,editColumns:k,editColumnsInitOpen:W,headers:he.current,hiddenColumns:qe,position:v,setHiddenColumns:Je})]})),e.jsx(se,{mainBodyRef:me,mainBodyWidth:Se,pinnedLeftWidth:De,pinnedRightWidth:He,setMainBodyWidth:je,tableBodyContainerRef:we}),e.jsx(p,{currentPage:ye,hideFooter:B,onPageChange:Ie,onNextPage:U,shouldPaginate:ne,totalPages:Math.ceil(K.length/G)})]}))}))}))};exports.SimpleTable=function(r){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(ye,t({},r)):null};
2
2
  //# sourceMappingURL=index.js.map
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-width:1px;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-color:var(--st-blue-400);--st-editable-cell-focus-border-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--st-dragging-background-color:var(--st-neutral-300);--st-selected-cell-background-color:var(--st-neutral-400);--st-selected-first-cell-background-color:var(--st-neutral-300);--st-footer-background-color:var(--st-neutral-50);--st-cell-color:var(--st-neutral-900);--st-cell-odd-row-color:var(--st-neutral-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-neutral-900);--st-selected-first-cell-color:var(--st-neutral-900);--st-resize-handle-color:var(--st-neutral-400);--st-separator-border-color:var(--st-neutral-200);--st-last-group-row-separator-border-color:var(--st-neutral-400);--st-selected-border-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--st-checkbox-checked-background-color:var(--st-neutral-600);--st-checkbox-checked-border-color:var(--st-neutral-600);--st-column-editor-background-color:var(--st-neutral-50);--st-column-editor-popout-background-color:var(--st-neutral-50);--st-button-hover-background-color:var(--st-neutral-200);--st-button-active-background-color:var(--st-neutral-600);--st-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-blue-50);--st-scrollbar-thumb-color:var(--st-blue-300);--st-border-color:var(--st-blue-300);--st-odd-row-background-color:var(--st-blue-50);--st-even-row-background-color:var(--st-blue-100);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-color:var(--st-blue-600);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-cell-padding:12px;--st-spacing-small:6px;--st-spacing-medium:10px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-color:var(--st-violet-500);--st-editable-cell-focus-border-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root *{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{border-bottom:var(--st-border-width) solid var(--st-border-color);display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{-webkit-box-flex:1;-ms-flex-positive:1;background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-height:100%}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color)}.st-row.odd .st-cell-content{color:var(--st-cell-odd-row-color)}.st-row.even .st-cell-content{color:var(--st-cell-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden;position:relative}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected .st-cell-content{color:var(--st-selected-cell-color)!important}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color)}.st-cell-selected-first .st-cell-content{color:var(--st-selected-first-cell-color)!important}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{height:100%}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{-ms-flex-negative:0;background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);flex-shrink:0;padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.st-page-ellipsis{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;color:var(--st-cell-color);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;justify-content:center;margin:0 var(--st-spacing-small);padding:var(--st-spacing-small)}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);font-size:.875rem;height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-column-editor-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}.st-dropdown-content{background-color:var(--st-odd-row-background-color);border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow);box-shadow:var(--st-edit-cell-shadow);max-height:400px;min-width:120px;overflow:auto;position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);will-change:transform;z-index:100}.st-dropdown-bottom-left,.st-dropdown-bottom-right{margin-top:4px}.st-dropdown-top-left,.st-dropdown-top-right{margin-bottom:4px}.st-dropdown-item{cursor:pointer;padding:8px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);white-space:nowrap}.st-dropdown-item:hover{background-color:var(--st-button-hover-background-color)}.st-dropdown-item.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-dropdown-group-label{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 12px}.st-dropdown-divider{background-color:var(--st-border-color);height:1px;margin:4px 0}.st-datepicker{background-color:var(--st-odd-row-background-color);font-family:inherit}.st-datepicker-header{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;padding:10px}.st-datepicker-header-label{-webkit-box-flex:1;cursor:pointer;-ms-flex:1;flex:1;font-weight:600;text-align:center}.st-datepicker-nav-btn{background:#0000;border:none;border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;font-size:1.2em;padding:0 8px}.st-datepicker-nav-btn:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-grid{display:grid;padding:10px}.st-datepicker-days-grid{gap:4px;grid-template-columns:repeat(7,1fr)}.st-datepicker-months-grid,.st-datepicker-years-grid{gap:8px;grid-template-columns:repeat(3,1fr)}.st-datepicker-weekday{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 0;text-align:center}.st-datepicker-day{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:50%;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:32px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-day.empty{cursor:default}.st-datepicker-day:not(.empty):hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-day.today{color:var(--st-button-active-background-color);font-weight:600}.st-datepicker-day.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-day.other-month{color:var(--st-slate-400)}.st-datepicker-month,.st-datepicker-year{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:var(--st-border-radius);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:12px 8px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-month:hover,.st-datepicker-year:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-month.selected,.st-datepicker-year.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-footer{-webkit-box-pack:end;-ms-flex-pack:end;border-top:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-end;padding:10px}.st-datepicker-today-btn{background-color:initial;border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;padding:6px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-today-btn:hover{background-color:var(--st-button-hover-background-color)}
1
+ @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-width:1px;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-color:var(--st-blue-400);--st-editable-cell-focus-border-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--st-dragging-background-color:var(--st-neutral-300);--st-selected-cell-background-color:var(--st-neutral-400);--st-selected-first-cell-background-color:var(--st-neutral-300);--st-footer-background-color:var(--st-neutral-50);--st-cell-color:var(--st-neutral-900);--st-cell-odd-row-color:var(--st-neutral-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-neutral-900);--st-selected-first-cell-color:var(--st-neutral-900);--st-resize-handle-color:var(--st-neutral-400);--st-separator-border-color:var(--st-neutral-200);--st-last-group-row-separator-border-color:var(--st-neutral-400);--st-selected-border-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--st-checkbox-checked-background-color:var(--st-neutral-600);--st-checkbox-checked-border-color:var(--st-neutral-600);--st-column-editor-background-color:var(--st-neutral-50);--st-column-editor-popout-background-color:var(--st-neutral-50);--st-button-hover-background-color:var(--st-neutral-200);--st-button-active-background-color:var(--st-neutral-600);--st-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-blue-50);--st-scrollbar-thumb-color:var(--st-blue-300);--st-border-color:var(--st-blue-300);--st-odd-row-background-color:var(--st-blue-50);--st-even-row-background-color:var(--st-blue-100);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-color:var(--st-blue-600);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-cell-padding:12px;--st-spacing-small:6px;--st-spacing-medium:10px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-color:var(--st-violet-500);--st-editable-cell-focus-border-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root *{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{border-bottom:var(--st-border-width) solid var(--st-border-color);display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{-webkit-box-flex:1;-ms-flex-positive:1;background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-height:100%}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color)}.st-row.odd .st-cell-content{color:var(--st-cell-odd-row-color)}.st-row.even .st-cell-content{color:var(--st-cell-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden;position:relative}.st-cell.left-aligned,.st-header-cell.left-aligned{padding-left:var(--st-cell-padding);text-align:left}.st-cell.center-aligned,.st-header-cell.center-aligned{text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label-text{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;width:100%}.st-cell-content,.st-header-label-text{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label-text{color:var(--st-header-label-color);padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-cell-content.left-aligned,.st-header-label-text.left-aligned{text-align:left}.st-cell-content.center-aligned,.st-header-label-text.center-aligned{text-align:center}.st-cell-content.right-aligned,.st-header-label-text.right-aligned{text-align:right}.st-not-resizeable .st-cell-content{padding-left:var(--st-cell-padding);padding-right:var(--st-cell-padding)}.st-resizeable .st-body-pinned-right .st-cell-content{padding-left:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right));padding-right:var(--st-cell-padding)}.st-resizeable .st-body-main .st-cell-content,.st-resizeable .st-body-pinned-left .st-cell-content{padding-left:var(--st-cell-padding);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell{border:var(--st-border-width) solid #0000}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{-ms-flex-negative:0;background-color:var(--st-resize-handle-color);cursor:col-resize;flex-shrink:0;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected .st-cell-content{color:var(--st-selected-cell-color)!important}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color)}.st-cell-selected-first .st-cell-content{color:var(--st-selected-first-cell-color)!important}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{height:100%}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{-ms-flex-negative:0;background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);flex-shrink:0;padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.st-page-ellipsis{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;color:var(--st-cell-color);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;justify-content:center;margin:0 var(--st-spacing-small);padding:var(--st-spacing-small)}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);font-size:.875rem;height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-column-editor-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}.st-dropdown-content{background-color:var(--st-odd-row-background-color);border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow);box-shadow:var(--st-edit-cell-shadow);max-height:400px;min-width:120px;overflow:auto;position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);will-change:transform;z-index:100}.st-dropdown-bottom-left,.st-dropdown-bottom-right{margin-top:4px}.st-dropdown-top-left,.st-dropdown-top-right{margin-bottom:4px}.st-dropdown-item{cursor:pointer;padding:8px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);white-space:nowrap}.st-dropdown-item:hover{background-color:var(--st-button-hover-background-color)}.st-dropdown-item.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-dropdown-group-label{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 12px}.st-dropdown-divider{background-color:var(--st-border-color);height:1px;margin:4px 0}.st-datepicker{background-color:var(--st-odd-row-background-color);font-family:inherit}.st-datepicker-header{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;padding:10px}.st-datepicker-header-label{-webkit-box-flex:1;cursor:pointer;-ms-flex:1;flex:1;font-weight:600;text-align:center}.st-datepicker-nav-btn{background:#0000;border:none;border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;font-size:1.2em;padding:0 8px}.st-datepicker-nav-btn:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-grid{display:grid;padding:10px}.st-datepicker-days-grid{gap:4px;grid-template-columns:repeat(7,1fr)}.st-datepicker-months-grid,.st-datepicker-years-grid{gap:8px;grid-template-columns:repeat(3,1fr)}.st-datepicker-weekday{color:var(--st-slate-500);font-size:.8em;font-weight:600;padding:6px 0;text-align:center}.st-datepicker-day{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:50%;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:32px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-day.empty{cursor:default}.st-datepicker-day:not(.empty):hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-day.today{color:var(--st-button-active-background-color);font-weight:600}.st-datepicker-day.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-day.other-month{color:var(--st-slate-400)}.st-datepicker-month,.st-datepicker-year{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;border-radius:var(--st-border-radius);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:12px 8px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-month:hover,.st-datepicker-year:hover{background-color:var(--st-button-hover-background-color)}.st-datepicker-month.selected,.st-datepicker-year.selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-datepicker-footer{-webkit-box-pack:end;-ms-flex-pack:end;border-top:1px solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-end;padding:10px}.st-datepicker-today-btn{background-color:initial;border:1px solid var(--st-border-color);border-radius:var(--st-border-radius);color:var(--st-cell-color);cursor:pointer;padding:6px 12px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-datepicker-today-btn:hover{background-color:var(--st-button-hover-background-color)}
@@ -0,0 +1 @@
1
+ export declare const deepClone: <T>(obj: T) => T;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.13",
2
+ "version": "0.8.15",
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",
@@ -23,8 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "peerDependencies": {
26
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
27
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
26
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@babel/preset-react": "^7.25.7",