simple-table-core 1.1.5 → 1.1.6

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.
@@ -2,11 +2,12 @@
2
2
  import HeaderObject from "../types/HeaderObject";
3
3
  import Row from "../types/Row";
4
4
  import SortConfig from "../types/SortConfig";
5
- declare const useSortableData: ({ headers, tableRows, externalSortHandling, onSortChange, }: {
5
+ declare const useSortableData: ({ headers, tableRows, externalSortHandling, onSortChange, rowGrouping, }: {
6
6
  headers: HeaderObject[];
7
7
  tableRows: Row[];
8
8
  externalSortHandling: boolean;
9
9
  onSortChange?: ((sort: SortConfig | null) => void) | undefined;
10
+ rowGrouping?: string[] | undefined;
10
11
  }) => {
11
12
  setSort: import("react").Dispatch<import("react").SetStateAction<SortConfig | null>>;
12
13
  sort: SortConfig | null;
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 r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,forwardRef as d,Fragment as h,cloneElement as f,createRef as v,useLayoutEffect as p,useReducer as m}from"react";var g=function(){return g=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},g.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(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)},x=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},I=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},S=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return S(e)}):[e]},E=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){E(e)})},N=function(e){return"number"==typeof e.minWidth?e.minWidth:40},R=function(e,n,t){return t&&void 0!==e[t]?e[t]:n},k=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=R(t,a,c),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return Array.isArray(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},F=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},D=s(void 0),H=function(n){var t=n.children,r=n.value;return e(D.Provider,g({value:r},{children:t}))},T=function(){var e=u(D);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},M=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=T(),d=u.nextIcon,h=u.prevIcon,f=o(!0),v=f[0],p=f[1],m=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",g({className:"st-footer"},{children:[e("button",g({className:"st-next-prev-btn ".concat(m?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:m},{children:h})),e("button",g({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",g({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",g({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},A=function(n){var t=n.className;return e("svg",g({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"})}))},W=function(n){var t=n.className;return e("svg",g({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(e){return e.position*(e.rowHeight+1)-1},B=function(e){return e.position*(e.rowHeight+1)},O=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=T().mainBodyRef,m=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],x=o({}),I=x[0],S=x[1],E=o(!1),N=E[0],R=E[1];return c(function(){a&&m.current?(R(!1),!w.current&&m.current.parentElement&&(w.current=m.current.parentElement),requestAnimationFrame(function(){if(m.current&&w.current){var e,n=m.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),S(c),R(!0)}})):a||R(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&m.current){var n=e.target;m.current&&!m.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){m.current&&!m.current.contains(e.target)&&(u(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",g({ref:m,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:g(g({position:v,width:d?"".concat(d,"px"):"auto",visibility:N?"visible":"hidden"},I),{overflow:s})},{children:t})):null},q=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",g({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},P=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return n(O,g({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(q,g({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(q,g({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},z=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},j=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},U=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=T(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],m=o("days"),w=m[0],y=m[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",g({className:"st-datepicker"},{children:[n("div",g({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",g({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),n("div",g({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",g({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",g({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",g({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",g({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",g({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",g({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e("div",g({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),l(n),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var m=35-(i+o),w=function(t){n.push(e("div",g({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=m;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",g({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",g({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",g({className:"st-datepicker-footer"},{children:e("button",g({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},Y=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setFullYear(t),i.setMonth(r-1),i.setDate(o),isNaN(i.getTime())?new Date:i},G=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(O,g({open:o,onClose:l,setOpen:i,width:280},{children:e(U,{value:Y(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},K=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(O,g({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",g({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(q,g({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},V=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(P,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(G,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(K,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(j,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(z,{defaultValue:u,onBlur:s,onChange:o})},X=0,J=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===X||o-X>=r)&&(X=o,n(t))}},$=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map($);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=$(e[t]));return n},Q=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Z=Date.now(),_={screenX:0,screenY:0},ee=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 b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=ee(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},ne=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function te(e,n,t){var r,o,i=$(e),a=!1;try{var l=ne(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=g({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var re=function(e){var n,t,r=e.draggedHeaderRef,o=e.headers,a=e.hoveredHeaderRef,l=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,u=T().setHeaders,d=(t=i(n=o),c(function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)},[n]),t.current);return{handleDragStart:function(e){r.current=e,Z=Date.now()},handleDragOver:function(e){var n=e.event,t=e.hoveredHeader;if(n.preventDefault(),o&&r.current){var i=n.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),l=n.screenX,c=n.screenY,u=Math.sqrt(Math.pow(l-_.screenX,2)+Math.pow(c-_.screenY,2));a.current=t;var h,f=r.current,v=!1;if(ne(f)!==ne(t)){h=(x=te(o,f,t)).newHeaders,v=x.emergencyBreak}else{var p=o,m=ee(p,f.accessor),g=ee(p,t.accessor);if(!m||!g)return;var w=m.length,y=g.length,b=g;if(w!==y){var C=y-w;C>0&&(b=g.slice(0,-C))}var x=function(e,n,t){var r=$(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,m,b);h=x.newHeaders,v=x.emergencyBreak}if(!(i||t.accessor===f.accessor||u<10||JSON.stringify(h)===JSON.stringify(o)||v)){var I=Date.now();JSON.stringify(h)===JSON.stringify(d)&&(I-Z<1500||u<40)||(Z=I,_={screenX:l,screenY:c},s(h))}}},handleDragEnd:function(){r.current=null,a.current=null,setTimeout(function(){u(function(e){return b([],e,!0)}),null==l||l(o)},10)}}},oe=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},ie=d(function(t,r){var a=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,h=t.isInitialFocused,f=t.nestedIndex,v=t.rowIndex,p=t.visibleRow,m=T(),w=m.cellRegistry,y=m.cellUpdateFlash,b=m.draggedHeaderRef,x=m.expandIcon,S=m.unexpandedRows,E=m.handleMouseDown,N=m.handleMouseOver,k=m.headers,F=m.hoveredHeaderRef,D=m.isCopyFlashing,H=m.isWarningFlashing,M=m.onCellEdit,A=m.onTableHeaderDragEnd,W=m.rowGrouping,L=m.rowIdAccessor,B=m.setUnexpandedRows,O=m.theme,q=m.useOddColumnBackground,P=p.depth,z=p.row,j=o(z[u.accessor]),U=j[0],Y=j[1],G=o(!1),K=G[0],X=G[1],$=o(!1),Q=$[0],Z=$[1],_=i(null),ee=R(z,v,L),ne=W&&W[P],te=!!ne&&function(e,n){if(!n)return!1;var t=e[n];return Array.isArray(t)&&t.length>0}(z,ne),ie=!S.has(String(ee)),ae=D({rowIndex:v,colIndex:s,rowId:ee}),le=H({rowIndex:v,colIndex:s,rowId:ee}),ce=re({draggedHeaderRef:b,headers:k,hoveredHeaderRef:F,onTableHeaderDragEnd:A}).handleDragOver,se=J(),ue="cell-".concat(v,"-").concat(s),de=I({rowId:ee,accessor:u.accessor});c(function(){if(w){var e="".concat(ee,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){U!==e?(Y(e),y&&(Z(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){Z(!1)},800))):Y(e)}}),function(){w.delete(e),_.current&&clearTimeout(_.current)}}},[w,y,ee,u.accessor,U]),c(function(){if(Q){var e=setTimeout(function(){Z(!1)},850);return function(){return clearTimeout(e)}}},[Q]),c(function(){Y(z[u.accessor])},[z,u.accessor]);var he="boolean"===u.type||"date"===u.type||"enum"===u.type,fe=Boolean(null==u?void 0:u.isEditable),ve="st-cell ".concat(P>0&&u.expandable?"st-cell-depth-".concat(P):""," ").concat(d?h?"st-cell-selected-first ".concat(a):"st-cell-selected ".concat(a):""," ").concat(fe?"clickable":""," ").concat(Q?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(ae?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(le?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(q?f%2==0?"even-column":"odd-column":""),pe=l(function(e){Y(e),z[u.accessor]=e,null==M||M({accessor:u.accessor,newValue:e,row:z,rowIndex:v})},[u.accessor,M,z,v]),me=l(function(){B(function(e){var n=new Set(e),t=String(ee);return n.has(t)?n.delete(t):n.add(t),n})},[ee,B]);return K&&!he?e("div",g({className:"st-cell-editing",id:C({accessor:u.accessor,rowIndex:v+1}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(V,{enumOptions:u.enumOptions,onChange:pe,setIsEditing:X,type:u.type,value:U})})):n("div",g({className:ve,id:ue,onDoubleClick:function(){return u.isEditable&&X(!0)},onMouseDown:function(){K||E({rowIndex:v,colIndex:s,rowId:ee})},onMouseOver:function(){K||N({rowIndex:v,colIndex:s,rowId:ee})},onDragOver:function(e){return se({callback:ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){K||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||K||(e.preventDefault(),X(!0))},ref:r,"data-row-index":v,"data-col-index":s,"data-row-id":ee,"data-accessor":u.accessor},{children:[u.expandable&&te?e("div",g({className:"st-icon-container st-expand-icon-container ".concat(ie?"expanded":"collapsed"),onClick:me},{children:x})):null,e("span",g({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:z,theme:O}):oe({content:U,header:u})})})),K&&he&&e(V,{enumOptions:u.enumOptions,onChange:pe,setIsEditing:X,type:u.type,value:U})]}),de)}),ae=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.visibleRow,u=i.filter(function(e){return x({header:e,pinned:a})});return e(t,{children:u.map(function(n,t){return e(le,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,visibleRow:s},C({accessor:n.accessor,rowIndex:l+1}))})})},le=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.visibleRow,u=t[r.accessor],d=T(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,m=d.rowIdAccessor;if(r.children){var g=r.children.filter(function(e){return x({header:e,pinned:a})});return e(h,{children:g.map(function(n){return e(le,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,visibleRow:s},C({accessor:n.accessor,rowIndex:l+1}))})})}var w=R(s.row,l,m),y={rowIndex:l,colIndex:u,rowId:w},b=f(y),I=v(y),S=p(y);return e(ie,{borderClass:b,colIndex:u,header:r,isHighlighted:I,isInitialFocused:S,nestedIndex:i,rowIndex:l,visibleRow:s},C({accessor:r.accessor,rowIndex:l+1}))},ce=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hoveredIndex,l=n.index,c=n.pinned,s=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,h=n.visibleRow,f=T().useHoverRowBackground,v=h.position;return e("div",g({className:"st-row ".concat(v%2==0?"even":"odd"," ").concat(a===l&&f?"hovered":""),onMouseEnter:function(){d(l)},style:{gridTemplateColumns:o,top:B({position:v,rowHeight:s}),height:"".concat(s,"px")}},{children:e(ae,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:v,rowIndices:u,visibleRow:h},l)}))},se=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",g({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:L({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},ue=s(void 0),de=["default"],he=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(ue);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,de),function(){n.current&&i(n.current,de)}},[n,o,i]),f(t,{ref:function(e){n.current=e}})},fe=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},ve=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,l=t.hoveredIndex,c=t.pinned,s=t.ref,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,v=t.templateColumns,p=t.totalHeight,m=t.visibleRows,w=t.width,y=c?"st-body-pinned-".concat(c):"st-body-main";return a(function(){return Q(i,c)},[i,c])?e(fe,g({condition:!c,wrapper:function(n){return e(he,g({childRef:s},{children:n}))}},{children:e("div",g({className:y,ref:s,style:g({position:"relative",height:"".concat(p,"px"),width:w},!c&&{flexGrow:1})},{children:m.map(function(t,a){return n(h,{children:[0!==a&&e(se,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:a-1}),e(ce,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:v,headers:i,hoveredIndex:l,index:a,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:f,visibleRow:t})]},t.position)})}))})):null};function pe(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&x({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}var me=function(t){var r=t.headerContainerRef,l=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.setScrollTop,m=t.tableRows,w=t.visibleRows,y=T(),b=y.headers,C=y.mainBodyRef,x=y.rowHeight,I=y.rowIdAccessor,S=y.scrollbarWidth,E=y.tableBodyContainerRef,N=o(null),k=N[0],F=N[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:r,mainSectionRef:E,scrollbarWidth:S});var D=i(null),H=function(e){return e.length}(m),M=H*(x+1)-1,A=a(function(){return pe({headers:b,pinnedLeftColumns:s,pinnedRightColumns:h})},[b,s,h]),W=a(function(){var e={};return w.forEach(function(n,t){var r=String(R(n.row,t,I));e[r]=t}),e},[w,I]),L={columnIndices:A,headerContainerRef:r,headers:b,hoveredIndex:k,rowHeight:x,rowIndices:W,setHoveredIndex:F,visibleRows:w};return n("div",g({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){p(n)})},ref:E},{children:[e(ve,g({},L,{pinned:"left",templateColumns:u,totalHeight:M,width:d})),e(ve,g({},L,{columnIndexStart:s.length,ref:C,templateColumns:l,totalHeight:M})),e(ve,g({},L,{columnIndexStart:s.length+l.length,pinned:"right",templateColumns:f,totalHeight:M,width:v}))]}))},ge=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,ge(e.children)),n})},we=function(e){return void 0===e&&(e=0),e?e+1:0},ye=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.startWidth;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(o&&!o.hide){var u=N(o),d=t-r>1,h=d?S(o):[o],f=function(e){var n="right"===o.pinned?c-e:e-c;if(d&&h.length>1)be({delta:n,leafHeaders:h,minWidth:u,startWidth:l});else{var t=Math.max(l+n,u);o.width=t}i.forEach(function(e){E(e)});var r=b([],i,!0);a(r)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var m=function(e){f(e.clientX)},g=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)}}},be=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,N(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/a),o=Math.max(n+t,r);e.width=o})},Ce=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=S(e).reduce(function(e,n){return e+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}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:we(t),rightWidth:we(r),mainWidth:o}},xe=function(n){var t=n.className,r=n.style;return e("svg",g({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:g({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Ie={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Se=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ee=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ne=function(e){return["between","notBetween","in","notIn"].includes(e)},Re=function(e){return["isEmpty","isNotEmpty"].includes(e)},ke=function(n){var t=n.children;return e("div",g({className:"st-filter-container"},{children:t}))},Fe=function(){return e("svg",g({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},De=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,h=void 0===d?"":d,f=t.disabled,v=void 0!==f&&f,p=o(!1),m=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],x=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(m)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(m)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[m,b,l,a]);return n("div",g({ref:x,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(m?"st-custom-select-open":"").trim()},{children:[n("button",g({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!m),m)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":m,"aria-labelledby":"select-label"},{children:[e("span",g({className:"st-custom-select-value"},{children:I?I.label:u})),e(Fe,{})]})),e(O,g({open:m,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",g({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",g({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},He=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Ie[e]}});return e("div",g({className:"st-filter-section"},{children:e(De,{value:t,onChange:function(e){r(e)},options:o})}))},Te=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(void 0===s?"":s).trim()})},Me=function(n){var t=n.children,r=n.className;return e("div",g({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ae=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",g({className:"st-filter-actions"},{children:[e("button",g({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",g({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},We=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=Se("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var m=Re(u)||f.trim();return n(ke,{children:[e(He,{value:u,onChange:d,operators:p}),Ee(u)&&e(Me,{children:e(Te,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0})}),e(Ae,{onApply:function(){var e=g({accessor:r.accessor,operator:u},Ee(u)&&{value:f});a(e)},onClear:l,canApply:!!m,showClear:!!i})]})},Le=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],m=v[1],g=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=g[0],y=g[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],x=b[1],I=Se("number");c(function(){var e,n;l?(f(l.operator),m(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),m(""),y(""),x(""))},[l]);return n(ke,{children:[e(He,{value:h,onChange:f,operators:I}),Ee(h)&&e(Me,{children:e(Te,{type:"number",value:p,onChange:m,placeholder:"Enter number...",autoFocus:!0})}),Ne(h)&&n(Me,{children:[e(Te,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e(Te,{type:"number",value:C,onChange:x,placeholder:"To..."})]}),e(Ae,{onApply:function(){var e={accessor:a.accessor,operator:h};Ee(h)?e.value=parseFloat(p):Ne(h)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)},onClear:u,canApply:!!Re(h)||(Ee(h)?""!==p.trim():!!Ne(h)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},Be=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(De,{value:t,onChange:r,options:o,className:a,placeholder:l})},Oe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=Se("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var m=Re(u)||""!==f;return n(ke,{children:[e(He,{value:u,onChange:d,operators:p}),Ee(u)&&e(Me,{children:e(Be,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ae,{onApply:function(){var e={accessor:r.accessor,operator:u};Ee(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:m,showClear:!!i})]})},qe=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),m=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],x=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=x[0],S=x[1],E=Se("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),S(""))},[s]);var N=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],m=v[1],w=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||m(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else m("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",g({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(O,g({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e(U,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return n(ke,{children:[e(He,{value:f,onChange:v,operators:E}),Ee(f)&&e(Me,{children:e(N,{value:m,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ne(f)&&n(Me,{children:[e(N,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(N,{value:I,onChange:S,placeholder:"To date..."})]}),e(Ae,{onApply:function(){var e={accessor:l.accessor,operator:f};Ee(f)?e.value=m:Ne(f)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Re(f)||(Ee(f)?""!==m.trim():!!Ne(f)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},Pe=function(n){var t=n.className,r=n.style;return e("svg",g({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:g({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ze=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",g({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",g({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Pe,{className:"st-checkbox-checkmark"})})),i]}))},je=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1];c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var p=f.length===d.length;return n(ke,{children:[e(Me,{children:n("div",g({className:"st-enum-filter-options"},{children:[e("div",g({className:"st-enum-select-all"},{children:e(ze,g({checked:p,onChange:function(e){v(e?d:[])}},{children:e("span",g({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(ze,g({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",g({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Ae,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},Ue=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(Le,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Oe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(qe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(je,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(We,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},Ye=d(function(t,r){var i,a,l=t.colIndex,s=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,p=t.sort,m=o(!1),w=m[0],y=m[1],x=T(),I=x.columnReordering,S=x.columnResizing,E=x.draggedHeaderRef,N=x.filters,R=x.handleApplyFilter,k=x.handleClearFilter,F=x.headers,D=x.hoveredHeaderRef,H=x.onColumnOrderChange,M=x.onSort,A=x.onTableHeaderDragEnd,W=x.rowHeight,L=x.selectColumns,B=x.selectableColumns,q=x.setHeaders,P=x.setInitialFocusedCell,z=x.setSelectedCells,j=x.setSelectedColumns,U=x.sortDownIcon,Y=x.sortUpIcon,G=Boolean(null==f?void 0:f.isSortable),K=Boolean(null==f?void 0:f.filterable),V=N[f.accessor],X="st-header-cell ".concat(f.accessor===(null===(i=D.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=E.current)||void 0===a?void 0:a.accessor)===f.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(I&&!G?"columnReordering":""," ").concat(f.children?"parent":""),$=re({draggedHeaderRef:E,headers:F,hoveredHeaderRef:D,onColumnOrderChange:H,onTableHeaderDragEnd:A}),Q=$.handleDragStart,Z=$.handleDragEnd,_=$.handleDragOver,ee=J(),ne=function(e){var n=e.event,t=e.header;if(B){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 l=a[i];o=r(l,o)}return o};return r(e,n),t}(t,l);return n.shiftKey&&L?j(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):L&&L(r),z(new Set),void P(null)}t.isSortable&&M(l,t.accessor)};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!f)return null;var te=S&&e("div",g({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;ee({callback:ye,callbackProps:{event:e.nativeEvent,gridColumnEnd:s,gridColumnStart:u,header:f,headers:F,setHeaders:q,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;ee({callback:ye,callbackProps:{event:e,gridColumnEnd:s,gridColumnStart:u,header:f,headers:F,setHeaders:q,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),oe=p&&p.key.accessor===f.accessor&&n("div",g({className:"st-icon-container",onClick:function(e){return ne({event:e,header:f})}},{children:["ascending"===p.direction&&Y&&Y,"descending"===p.direction&&U&&U]})),ie=K&&n("div",g({className:"st-icon-container",onClick:function(e){e.stopPropagation(),y(!w)}},{children:[e(xe,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(O,g({open:w,overflow:"visible",setOpen:y,onClose:function(){return y(!1)}},{children:e(Ue,{header:f,currentFilter:V,onApplyFilter:function(e){R(e),y(!1)},onClearFilter:function(){k(f.accessor),y(!1)}})}))]}));return n("div",g({className:X,id:C({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){ee({callback:_,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:g(g({gridRowStart:h,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:s},s-u>1?{}:{width:f.width}),d-h>1?{}:{height:W})},{children:[v&&te,"right"===f.align&&ie,"right"===f.align&&oe,e("div",g({className:"st-header-label",draggable:I&&!f.disableReorder,onClick:function(e){return ne({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),Z()},onDragStart:function(e){I&&f&&function(e){Q(e)}(f)}},{children:e("span",g({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:l,header:f}):null==f?void 0:f.label}))})),"right"!==f.align&&oe,"right"!==f.align&&ie,!v&&te]}))}),Ge=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,h=n.width,f=a(function(){var e=[],n=1,t=function(o,i,a){var l,u;if(void 0===a&&(a=!1),!x({header:o,pinned:s}))return 0;a||n++;var d=null!==(u=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return x({header:e,pinned:s})}).length)&&void 0!==u?u:0,h=n,f=d>0?h+d:h+1,v=i,p=d>0?i+1:c+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:f,gridRowStart:v,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach(function(e){x({header:e,pinned:s})&&(t(e,i+1,m),m=!1)})}return f-h},o=l.filter(function(e){return x({header:e,pinned:s})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r]);return e(fe,g({condition:!s,wrapper:function(n){return e(he,g({childRef:u},{children:n}))}},{children:e("div",g({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:h}},{children:e(t,{children:f.map(function(n){return e(Ye,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:v(),reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},Ke=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ke)):1},Ve=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headers,l=t.mainTemplateColumns,c=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,h=t.sort,f=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=T(),m=p.pinnedLeftRef,w=p.pinnedRightRef,y=a(function(){return pe({headers:i,pinnedLeftColumns:c,pinnedRightColumns:u})},[i,c,u]),b=a(function(){var e=0;return i.forEach(function(n){if(x({header:n})){var t=Ke(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return n("div",g({className:"st-header-container",ref:o},{children:[Q(i,"left")&&e(Ge,{columnIndices:y,gridTemplateColumns:s,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:m,sort:h,width:f}),e(Ge,{columnIndices:y,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:r,sort:h}),Q(i,"right")&&e(Ge,{columnIndices:y,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:w,sort:h,width:v})]}))},Xe=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Je=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.visibleRows,d=T(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=i(null),m=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return Xe({headers:y})},[y]),x=a(function(){return Xe({headers:w})},[w]),I=a(function(){return Xe({headers:b})},[b]),S={centerHeaderRef:m,headerContainerRef:p,headers:v,mainTemplateColumns:x,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},E={tableRows:s,headerContainerRef:p,mainTemplateColumns:x,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,visibleRows:u};return n("div",g({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(Ve,g({},S)),e(me,g({},E))]}))},$e=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,h=t.tableBodyContainerRef,f=T().editColumns,v=o(!1),p=v[0],m=v[1],w=i(null),y=h.current&&h.current.scrollHeight>h.current.clientHeight,b=f?28:0,C=(f?d+1:d)+(h.current&&y?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;m(l>e)}}()},1)},[s,l]),p?n("div",g({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(he,g({childRef:w},{children:e("div",g({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},Qe={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 Qe.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?Qe.string(e,n,t):"number"==typeof e&&"number"==typeof n?Qe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Qe.boolean(e,n,t):Qe.string(String(e),String(n),t)}},Ze=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 b([],e,!0).sort(function(e,t){var r=n.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return Qe.number(i,a,r)}return"date"===t?Qe.date(String(e),String(n),r):"boolean"===t?Qe.boolean(Boolean(e),Boolean(n),r):"enum"===t?Qe.enum(String(e),String(n),r):Qe.string(String(e),String(n),r)}(e[r],t[r],o,i)})},_e=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,l=o(null),c=l[0],s=l[1],u=a(function(){if(r)return t;if(!c)return t;var e=function(e,n,t){return{sortedData:Ze(n,t,e),newSortConfig:t}}(n,t,c).sortedData;return e},[t,c,n,r]);return{setSort:s,sort:c,sortedRows:u,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);if(o){var a=null;c&&c.key.accessor===t?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},s(a),null==i||i(a)}}}},en=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(en([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},nn=function(e){return e.every(function(e){return e.hide})},tn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(tn(e.children),nn(e.children)&&(e.hide=!0))})},rn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=T(),p=v.expandIcon,m=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,x=null!=u?u:s.hide||C&&s.children&&nn(s.children);return n(t,{children:[n("div",g({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",g({className:"st-header-icon-container"},{children:C?e("div",g({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(ze,g({checked:x,onChange:function(e){(s.hide=e,e)?tn(i):(en(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,en(i,s.children[0].accessor)));w(b([],m,!0))}},{children:s.label}))]})),C&&h&&s.children&&e("div",g({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(rn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},on=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",g({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",g({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return e(rn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},an=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?n("div",g({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",g({className:"st-column-editor-text"},{children:r})),e(on,{headers:l,open:d,position:s})]})):null},ln=function(n){var t=n.className;return e("svg",g({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},cn=function(n){var t=n.className;return e("svg",g({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},sn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(ue.Provider,g({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},un=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ie[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},dn=function(){var t=T(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",g({className:"st-filter-bar"},{children:e("div",g({className:"st-filter-bar-content"},{children:e("div",g({className:"st-filter-chips"},{children:a.map(function(t){return n("div",g({className:"st-filter-chip"},{children:[e("span",g({className:"st-filter-chip-text"},{children:un(t,i)})),e("button",g({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},hn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},fn=function(e){var n=e.externalFilterHandling,t=e.rows,r=o({}),i=r[0],c=r[1],s=a(function(){return n||0===Object.keys(i).length?t:t.filter(function(e){return Object.values(i).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=new Date(e),v=new Date(String(r||"")),p=hn(f),m=hn(v);switch(t){case"equals":return p.getTime()===m.getTime();case"notEquals":return p.getTime()!==m.getTime();case"before":return p<m;case"after":return p>m;case"between":if(o&&2===o.length){var g=o.map(function(e){return hn(new Date(String(e||"")))}),w=g[0],y=g[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return hn(new Date(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var x=String(e),I=o.includes(x);return"in"===t?I:!I}return!1}var S=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return S===E;case"notEquals":return S!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})})},[n,i,t]),u=l(function(e){c(function(n){var t;return g(g({},n),((t={})[e.accessor]=e,t))})},[]),d=l(function(e){c(function(n){var t=g({},n);return delete t[e],t})},[]),h=l(function(){c({})},[]);return{filters:i,filteredRows:s,handleApplyFilter:u,handleClearFilter:d,handleClearAllFilters:h}},vn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return ge(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&Array.isArray(l)){var c=i(l,t+1),s=g({},n);return s[o]=c,e.forEach(function(e){var n=pn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},pn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&Array.isArray(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.filter(function(e){return"number"==typeof e&&!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},mn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(gn,g({},n)):null},gn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,d=void 0!==u&&u,h=t.columnEditorPosition,f=void 0===h?"right":h,v=t.columnEditorText,b=void 0===v?"Columns":v,C=t.columnReordering,x=void 0!==C&&C,E=t.columnResizing,N=void 0!==E&&E,D=t.defaultHeaders,T=t.editColumns,L=void 0!==T&&T,B=t.editColumnsInitOpen,O=void 0!==B&&B,q=t.expandAll,P=void 0===q||q,z=t.expandIcon,j=void 0===z?e(W,{className:"st-expand-icon"}):z,U=t.externalFilterHandling,Y=void 0!==U&&U,G=t.externalSortHandling,K=void 0!==G&&G,V=t.height,X=t.hideFooter,J=void 0!==X&&X,$=t.nextIcon,Q=void 0===$?e(W,{className:"st-next-prev-icon"}):$,Z=t.onCellEdit,_=t.onColumnOrderChange,ee=t.onFilterChange,ne=t.onGridReady,te=t.onNextPage,re=t.onSortChange,oe=t.prevIcon,ie=void 0===oe?e(A,{className:"st-next-prev-icon"}):oe,ae=t.rowGrouping,le=t.rowHeight,ce=void 0===le?32:le,se=t.rowIdAccessor,ue=t.rows,de=t.rowsPerPage,he=void 0===de?10:de,fe=t.selectableCells,ve=void 0!==fe&&fe,pe=t.selectableColumns,me=void 0!==pe&&pe,ge=t.shouldPaginate,we=void 0!==ge&&ge,ye=t.sortDownIcon,be=void 0===ye?e(ln,{className:"st-header-icon"}):ye,xe=t.sortUpIcon,Ie=void 0===xe?e(cn,{className:"st-header-icon"}):xe,Se=t.tableRef,Ee=t.theme,Ne=void 0===Ee?"light":Ee,Re=t.useHoverRowBackground,ke=void 0===Re||Re,Fe=t.useOddEvenRowBackground,De=void 0===Fe||Fe,He=t.useOddColumnBackground,Te=void 0!==He&&He;Te&&(De=!1);var Me=m(function(e){return e+1},0)[1],Ae=i(null),We=i(null),Le=i(null),Be=i(null),Oe=i(null),qe=i(null),Pe=o(1),ze=Pe[0],je=Pe[1],Ue=o(D),Ye=Ue[0],Ge=Ue[1];c(function(){Ge(D)},[D]);var Ke=o(0),Ve=Ke[0],Xe=Ke[1],Qe=o(0),Ze=Qe[0],en=Qe[1],nn=o(new Set),tn=nn[0],rn=nn[1],on=fn({externalFilterHandling:Y,rows:ue}),un=on.filters,hn=on.filteredRows,pn=on.handleApplyFilter,mn=on.handleClearFilter,gn=on.handleClearAllFilters,wn=l(function(e){pn(e)},[pn]),yn=_e({headers:Ye,tableRows:hn,externalSortHandling:K,onSortChange:re}),bn=yn.sort,Cn=yn.sortedRows,xn=yn.updateSort;c(function(){null==ee||ee(un)},[un,ee]),c(function(){null==re||re(bn)},[bn,re]);var In=a(function(){var e=Ce({headers:Ye});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Ye]),Sn=In.mainBodyWidth,En=In.pinnedLeftWidth,Nn=In.pinnedRightWidth;c(function(){null==ne||ne()},[ne]);var Rn=a(function(){if(!we)return Cn;var e=(ze-1)*he,n=e+he;return Cn.slice(e,n)},[ze,he,we,Cn]),kn=vn({rows:Rn,headers:Ye,rowGrouping:ae}),Fn=a(function(){return ae&&0!==ae.length?k({rows:kn,rowGrouping:ae,rowIdAccessor:se,unexpandedRows:tn,expandAll:P}):kn.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[kn,ae,se,tn,P]),Dn=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:V,rowHeight:ce}),Hn=a(function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.tableRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=Math.max(0,i-a*n),c=i+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(r.length,Math.ceil(c/a));return r.slice(s,u)}({bufferRowCount:5,contentHeight:Dn,tableRows:Fn,rowHeight:ce,scrollTop:Ve})},[Dn,ce,Fn,Ve]),Tn=i(new Map),Mn=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=o(new Set),f=h[0],v=h[1],p=o(new Set),m=p[0],g=p[1],b=o(null),C=b[0],x=b[1],I=o(null),E=I[0],N=I[1],k=o(new Set),D=k[0],H=k[1],T=o(new Set),M=T[0],A=T[1],W=i(!1),L=i(null),B=a(function(){return t.flatMap(S)},[t]),O=l(function(){var e=B.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(o),H(new Set(f)),setTimeout(function(){H(new Set)},800))},[B,f,r]),q=l(function(){return w(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(h){switch(h.label){case 0:if(!E)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=B.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=E.rowIndex,l=E.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],m=R(v.row,h,s);if(null==p?void 0:p.isEditable){var g=e;if("number"===p.type){var w=Number(e);isNaN(w)||(g=w)}else if("boolean"===p.type)g="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(g=y)}if(v.row[p.accessor]=g,d){var b="".concat(m,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(g)}null==u||u({accessor:p.accessor,newValue:g,row:v.row,rowIndex:h});var x=F({colIndex:f,rowIndex:h,rowId:m});o.add(x)}else{var I=F({colIndex:f,rowIndex:h,rowId:m});i.add(I)}}})}),o.size>0&&(H(o),setTimeout(function(){H(new Set)},800)),i.size>0&&(A(i),setTimeout(function(){A(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[E,B,r,s,u,d]),P=l(function(){if(0!==f.size){var e=B.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=R(c.row,a,s);if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),m=d.get(p);m&&m.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(H(t),setTimeout(function(){H(new Set)},800)),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800))}},[f,B,r,s,u,d]),z=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=R(r[c].row,c,s);t.add(F({colIndex:u,rowIndex:c,rowId:d}))}g(new Set),x(null),v(t)},[r,s,g,x,v]),j=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<B.length){var n=F(e);g(new Set),x(null),v(new Set([n])),N(e)}},[B.length,r.length,g,x,v,N]),U=l(function(e,n){void 0===n&&(n=!1),v(new Set),N(null),g(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&x(e[e.length-1])},[v,N,g,x]);c(function(){var e=function(e){var t;if(n&&E){var o=E.rowIndex,i=E.colIndex,a=E.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void q();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void P();if(R(null===(t=r[o])||void 0===t?void 0:t.row,o,s)!==a){var l=r.findIndex(function(e,n){return R(e.row,n,s)===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=R(r[o-1].row,o-1,s);j({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=R(r[o+1].row,o+1,s),j({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=R(r[o].row,o,s),j({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<B.length-1&&(c=R(r[o].row,o,s),j({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),g(new Set),x(null),L.current=null,N(null))}else O()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[O,B.length,E,s,z,j,n,r,q,P]);var Y=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=m.has(n);return i||a},[f,m]),G=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?R(r[t-1].row,t-1,s):null,l=r[t+1]?R(r[t+1].row,t+1,s):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!Y(c)||m.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||m.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(h)||i.push("st-selected-right-border"),i.join(" ")},[Y,r,m,s]),K=a(function(){return E?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===E.rowIndex&&t===E.colIndex&&r===E.rowId}:function(){return!1}},[E]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]),X=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return M.has(o)},[M]);return{getBorderClass:G,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(W.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){g(new Set),x(null);var e=F({colIndex:t,rowIndex:r,rowId:o});v(new Set([e])),N({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&W.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=R(r[d].row,d,s);i.add(F({colIndex:h,rowIndex:d,rowId:f}))}v(i)}},handleMouseUp:function(){W.current=!1},isCopyFlashing:V,isWarningFlashing:X,isInitialFocusedCell:K,isSelected:Y,lastSelectedColumnIndex:C,pasteFromClipboard:q,selectColumns:U,selectedCells:f,selectedColumns:m,setInitialFocusedCell:N,setSelectedCells:v,setSelectedColumns:g,deleteSelectedCells:P}}({selectableCells:ve,headers:Ye,tableRows:Fn,rowIdAccessor:se,onCellEdit:Z,cellRegistry:Tn.current}),An=Mn.getBorderClass,Wn=Mn.handleMouseDown,Ln=Mn.handleMouseOver,Bn=Mn.handleMouseUp,On=Mn.isCopyFlashing,qn=Mn.isInitialFocusedCell,Pn=Mn.isSelected,zn=Mn.isWarningFlashing,jn=Mn.selectColumns,Un=Mn.selectedCells,Yn=Mn.selectedColumns,Gn=Mn.setInitialFocusedCell,Kn=Mn.setSelectedCells,Vn=Mn.setSelectedColumns,Xn=l(function(e,n){xn(e,n)},[xn]),Jn=l(function(e){Ge(e)},[]);return function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns;c(function(){var e=function(e){var a=e.target;a.closest(".st-cell")||n&&(a.classList.contains("st-header-cell")||a.classList.contains("st-header-label"))||(t.size>0&&o(new Set),r.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i])}({selectableColumns:me,selectedCells:Un,selectedColumns:Yn,setSelectedCells:Kn,setSelectedColumns:Vn}),p(function(){if(qe.current){var e=qe.current.offsetWidth-qe.current.clientWidth;en(e)}},[]),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;p(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:Me,tableBodyContainerRef:qe,setScrollbarWidth:en}),c(function(){Se&&(Se.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,r=e.newValue,o=null==ue?void 0:ue[t];if(o){var i=R(o,t,se),a=I({rowId:i,accessor:n}),l=Tn.current.get(a);l&&l.updateContent(r),void 0!==o[n]&&(o[n]=r)}}})},[Se,ue,se]),e(H,g({value:{allowAnimations:s,cellRegistry:Tn.current,cellUpdateFlash:d,columnReordering:x,columnResizing:N,draggedHeaderRef:Ae,editColumns:L,expandIcon:j,unexpandedRows:tn,filters:un,tableRows:Fn,forceUpdate:Me,getBorderClass:An,handleApplyFilter:wn,handleClearFilter:mn,handleClearAllFilters:gn,handleMouseDown:Wn,handleMouseOver:Ln,headers:Ye,hoveredHeaderRef:We,isCopyFlashing:On,isInitialFocusedCell:qn,isSelected:Pn,isWarningFlashing:zn,mainBodyRef:Le,nextIcon:Q,onCellEdit:Z,onColumnOrderChange:_,onSort:Xn,onTableHeaderDragEnd:Jn,pinnedLeftRef:Be,pinnedRightRef:Oe,prevIcon:ie,rowGrouping:ae,rowHeight:ce,rowIdAccessor:se,scrollbarWidth:Ze,selectColumns:jn,selectableColumns:me,setUnexpandedRows:rn,setHeaders:Ge,setInitialFocusedCell:Gn,setSelectedCells:Kn,setSelectedColumns:Vn,shouldPaginate:we,sortDownIcon:be,sortUpIcon:Ie,tableBodyContainerRef:qe,theme:Ne,useHoverRowBackground:ke,useOddColumnBackground:Te,useOddEvenRowBackground:De}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(Ne),style:V?{height:V}:{}},{children:e(sn,{children:n("div",g({className:"st-wrapper-container"},{children:[e(dn,{}),n("div",g({className:"st-content-wrapper",onMouseUp:Bn,onMouseLeave:Bn},{children:[e(Je,{tableRows:Fn,pinnedLeftWidth:En,pinnedRightWidth:Nn,setScrollTop:Xe,sort:bn,visibleRows:Hn}),e(an,{columnEditorText:b,editColumns:L,editColumnsInitOpen:O,headers:Ye,position:f})]})),e($e,{mainBodyRef:Le,mainBodyWidth:Sn,pinnedLeftWidth:En,pinnedRightWidth:Nn,tableBodyContainerRef:qe}),e(M,{currentPage:ze,hideFooter:J,onPageChange:je,onNextPage:te,shouldPaginate:we,totalPages:Math.ceil(Cn.length/he)})]}))})}))}))};export{mn as SimpleTable};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,forwardRef as d,Fragment as h,cloneElement as f,createRef as v,useLayoutEffect as p,useReducer as g}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 w(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(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)},x=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},I=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},S=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return S(e)}):[e]},E=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){E(e)})},N=function(e){return"number"==typeof e.minWidth?e.minWidth:40},R=function(e,n,t){return t&&void 0!==e[t]?e[t]:n},k=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=R(t,a,c),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return Array.isArray(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},F=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},D=s(void 0),H=function(n){var t=n.children,r=n.value;return e(D.Provider,m({value:r},{children:t}))},T=function(){var e=u(D);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},M=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=T(),d=u.nextIcon,h=u.prevIcon,f=o(!0),v=f[0],p=f[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:h})),e("button",m({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.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<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},A=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"})}))},W=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(e){return e.position*(e.rowHeight+1)-1},B=function(e){return e.position*(e.rowHeight+1)},O=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=T().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],x=o({}),I=x[0],S=x[1],E=o(!1),N=E[0],R=E[1];return c(function(){a&&g.current?(R(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),S(c),R(!0)}})):a||R(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){g.current&&!g.current.contains(e.target)&&(u(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:N?"visible":"hidden"},I),{overflow:s})},{children:t})):null},q=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},P=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return n(O,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(q,m({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(q,m({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},z=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},j=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},U=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=T(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return 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 y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),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=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).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),l(n),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)w(f);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},Y=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setFullYear(t),i.setMonth(r-1),i.setDate(o),isNaN(i.getTime())?new Date:i},G=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(O,m({open:o,onClose:l,setOpen:i,width:280},{children:e(U,{value:Y(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},K=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(O,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(q,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},V=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(P,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(G,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(K,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(j,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(z,{defaultValue:u,onBlur:s,onChange:o})},X=0,J=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===X||o-X>=r)&&(X=o,n(t))}},$=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map($);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=$(e[t]));return n},Q=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Z=Date.now(),_={screenX:0,screenY:0},ee=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 b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=ee(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},ne=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function te(e,n,t){var r,o,i=$(e),a=!1;try{var l=ne(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=m({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var re=function(e){var n,t,r=e.draggedHeaderRef,o=e.headers,a=e.hoveredHeaderRef,l=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,u=T().setHeaders,d=(t=i(n=o),c(function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)},[n]),t.current);return{handleDragStart:function(e){r.current=e,Z=Date.now()},handleDragOver:function(e){var n=e.event,t=e.hoveredHeader;if(n.preventDefault(),o&&r.current){var i=n.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),l=n.screenX,c=n.screenY,u=Math.sqrt(Math.pow(l-_.screenX,2)+Math.pow(c-_.screenY,2));a.current=t;var h,f=r.current,v=!1;if(ne(f)!==ne(t)){h=(x=te(o,f,t)).newHeaders,v=x.emergencyBreak}else{var p=o,g=ee(p,f.accessor),m=ee(p,t.accessor);if(!g||!m)return;var w=g.length,y=m.length,b=m;if(w!==y){var C=y-w;C>0&&(b=m.slice(0,-C))}var x=function(e,n,t){var r=$(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);h=x.newHeaders,v=x.emergencyBreak}if(!(i||t.accessor===f.accessor||u<10||JSON.stringify(h)===JSON.stringify(o)||v)){var I=Date.now();JSON.stringify(h)===JSON.stringify(d)&&(I-Z<1500||u<40)||(Z=I,_={screenX:l,screenY:c},s(h))}}},handleDragEnd:function(){r.current=null,a.current=null,setTimeout(function(){u(function(e){return b([],e,!0)}),null==l||l(o)},10)}}},oe=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},ie=d(function(t,r){var a=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,h=t.isInitialFocused,f=t.nestedIndex,v=t.rowIndex,p=t.visibleRow,g=T(),w=g.cellRegistry,y=g.cellUpdateFlash,b=g.draggedHeaderRef,x=g.expandIcon,S=g.unexpandedRows,E=g.handleMouseDown,N=g.handleMouseOver,k=g.headers,F=g.hoveredHeaderRef,D=g.isCopyFlashing,H=g.isWarningFlashing,M=g.onCellEdit,A=g.onTableHeaderDragEnd,W=g.rowGrouping,L=g.rowIdAccessor,B=g.setUnexpandedRows,O=g.theme,q=g.useOddColumnBackground,P=p.depth,z=p.row,j=o(z[u.accessor]),U=j[0],Y=j[1],G=o(!1),K=G[0],X=G[1],$=o(!1),Q=$[0],Z=$[1],_=i(null),ee=R(z,v,L),ne=W&&W[P],te=!!ne&&function(e,n){if(!n)return!1;var t=e[n];return Array.isArray(t)&&t.length>0}(z,ne),ie=!S.has(String(ee)),ae=D({rowIndex:v,colIndex:s,rowId:ee}),le=H({rowIndex:v,colIndex:s,rowId:ee}),ce=re({draggedHeaderRef:b,headers:k,hoveredHeaderRef:F,onTableHeaderDragEnd:A}).handleDragOver,se=J(),ue="cell-".concat(v,"-").concat(s),de=I({rowId:ee,accessor:u.accessor});c(function(){if(w){var e="".concat(ee,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){U!==e?(Y(e),y&&(Z(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){Z(!1)},800))):Y(e)}}),function(){w.delete(e),_.current&&clearTimeout(_.current)}}},[w,y,ee,u.accessor,U]),c(function(){if(Q){var e=setTimeout(function(){Z(!1)},850);return function(){return clearTimeout(e)}}},[Q]),c(function(){Y(z[u.accessor])},[z,u.accessor]);var he="boolean"===u.type||"date"===u.type||"enum"===u.type,fe=Boolean(null==u?void 0:u.isEditable),ve="st-cell ".concat(P>0&&u.expandable?"st-cell-depth-".concat(P):""," ").concat(d?h?"st-cell-selected-first ".concat(a):"st-cell-selected ".concat(a):""," ").concat(fe?"clickable":""," ").concat(Q?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(ae?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(le?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(q?f%2==0?"even-column":"odd-column":""),pe=l(function(e){Y(e),z[u.accessor]=e,null==M||M({accessor:u.accessor,newValue:e,row:z,rowIndex:v})},[u.accessor,M,z,v]),ge=l(function(){B(function(e){var n=new Set(e),t=String(ee);return n.has(t)?n.delete(t):n.add(t),n})},[ee,B]);return K&&!he?e("div",m({className:"st-cell-editing",id:C({accessor:u.accessor,rowIndex:v+1}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(V,{enumOptions:u.enumOptions,onChange:pe,setIsEditing:X,type:u.type,value:U})})):n("div",m({className:ve,id:ue,onDoubleClick:function(){return u.isEditable&&X(!0)},onMouseDown:function(){K||E({rowIndex:v,colIndex:s,rowId:ee})},onMouseOver:function(){K||N({rowIndex:v,colIndex:s,rowId:ee})},onDragOver:function(e){return se({callback:ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){K||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||K||(e.preventDefault(),X(!0))},ref:r,"data-row-index":v,"data-col-index":s,"data-row-id":ee,"data-accessor":u.accessor},{children:[u.expandable&&te?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(ie?"expanded":"collapsed"),onClick:ge},{children:x})):null,e("span",m({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:z,theme:O}):oe({content:U,header:u})})})),K&&he&&e(V,{enumOptions:u.enumOptions,onChange:pe,setIsEditing:X,type:u.type,value:U})]}),de)}),ae=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.visibleRow,u=i.filter(function(e){return x({header:e,pinned:a})});return e(t,{children:u.map(function(n,t){return e(le,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,visibleRow:s},C({accessor:n.accessor,rowIndex:l+1}))})})},le=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.visibleRow,u=t[r.accessor],d=T(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor;if(r.children){var m=r.children.filter(function(e){return x({header:e,pinned:a})});return e(h,{children:m.map(function(n){return e(le,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,visibleRow:s},C({accessor:n.accessor,rowIndex:l+1}))})})}var w=R(s.row,l,g),y={rowIndex:l,colIndex:u,rowId:w},b=f(y),I=v(y),S=p(y);return e(ie,{borderClass:b,colIndex:u,header:r,isHighlighted:I,isInitialFocused:S,nestedIndex:i,rowIndex:l,visibleRow:s},C({accessor:r.accessor,rowIndex:l+1}))},ce=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hoveredIndex,l=n.index,c=n.pinned,s=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,h=n.visibleRow,f=T().useHoverRowBackground,v=h.position;return e("div",m({className:"st-row ".concat(v%2==0?"even":"odd"," ").concat(a===l&&f?"hovered":""),onMouseEnter:function(){d(l)},style:{gridTemplateColumns:o,top:B({position:v,rowHeight:s}),height:"".concat(s,"px")}},{children:e(ae,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:v,rowIndices:u,visibleRow:h},l)}))},se=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:L({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},ue=s(void 0),de=["default"],he=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(ue);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,de),function(){n.current&&i(n.current,de)}},[n,o,i]),f(t,{ref:function(e){n.current=e}})},fe=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},ve=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,l=t.hoveredIndex,c=t.pinned,s=t.ref,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,v=t.templateColumns,p=t.totalHeight,g=t.visibleRows,w=t.width,y=c?"st-body-pinned-".concat(c):"st-body-main";return a(function(){return Q(i,c)},[i,c])?e(fe,m({condition:!c,wrapper:function(n){return e(he,m({childRef:s},{children:n}))}},{children:e("div",m({className:y,ref:s,style:m({position:"relative",height:"".concat(p,"px"),width:w},!c&&{flexGrow:1})},{children:g.map(function(t,a){return n(h,{children:[0!==a&&e(se,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:a-1}),e(ce,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:v,headers:i,hoveredIndex:l,index:a,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:f,visibleRow:t})]},t.position)})}))})):null};function pe(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&x({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}var ge=function(t){var r=t.headerContainerRef,l=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,h=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.setScrollTop,g=t.tableRows,w=t.visibleRows,y=T(),b=y.headers,C=y.mainBodyRef,x=y.rowHeight,I=y.rowIdAccessor,S=y.scrollbarWidth,E=y.tableBodyContainerRef,N=o(null),k=N[0],F=N[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:r,mainSectionRef:E,scrollbarWidth:S});var D=i(null),H=function(e){return e.length}(g),M=H*(x+1)-1,A=a(function(){return pe({headers:b,pinnedLeftColumns:s,pinnedRightColumns:h})},[b,s,h]),W=a(function(){var e={};return w.forEach(function(n,t){var r=String(R(n.row,t,I));e[r]=t}),e},[w,I]),L={columnIndices:A,headerContainerRef:r,headers:b,hoveredIndex:k,rowHeight:x,rowIndices:W,setHoveredIndex:F,visibleRows:w};return n("div",m({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){p(n)})},ref:E},{children:[e(ve,m({},L,{pinned:"left",templateColumns:u,totalHeight:M,width:d})),e(ve,m({},L,{columnIndexStart:s.length,ref:C,templateColumns:l,totalHeight:M})),e(ve,m({},L,{columnIndexStart:s.length+l.length,pinned:"right",templateColumns:f,totalHeight:M,width:v}))]}))},me=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,me(e.children)),n})},we=function(e){return void 0===e&&(e=0),e?e+1:0},ye=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.startWidth;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(o&&!o.hide){var u=N(o),d=t-r>1,h=d?S(o):[o],f=function(e){var n="right"===o.pinned?c-e:e-c;if(d&&h.length>1)be({delta:n,leafHeaders:h,minWidth:u,startWidth:l});else{var t=Math.max(l+n,u);o.width=t}i.forEach(function(e){E(e)});var r=b([],i,!0);a(r)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){f(e.clientX)},m=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)}}},be=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,N(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/a),o=Math.max(n+t,r);e.width=o})},Ce=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=S(e).reduce(function(e,n){return e+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}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:we(t),rightWidth:we(r),mainWidth:o}},xe=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Ie={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Se=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ee=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ne=function(e){return["between","notBetween","in","notIn"].includes(e)},Re=function(e){return["isEmpty","isNotEmpty"].includes(e)},ke=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},Fe=function(){return e("svg",m({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},De=function(t){var r=t.value,a=t.onChange,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,h=void 0===d?"":d,f=t.disabled,v=void 0!==f&&f,p=o(!1),g=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],x=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",m({ref:x,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:I?I.label:u})),e(Fe,{})]})),e(O,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},He=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Ie[e]}});return e("div",m({className:"st-filter-section"},{children:e(De,{value:t,onChange:function(e){r(e)},options:o})}))},Te=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(void 0===s?"":s).trim()})},Me=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ae=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},We=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=Se("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=Re(u)||f.trim();return n(ke,{children:[e(He,{value:u,onChange:d,operators:p}),Ee(u)&&e(Me,{children:e(Te,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0})}),e(Ae,{onApply:function(){var e=m({accessor:r.accessor,operator:u},Ee(u)&&{value:f});a(e)},onClear:l,canApply:!!g,showClear:!!i})]})},Le=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],m=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=m[0],y=m[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],x=b[1],I=Se("number");c(function(){var e,n;l?(f(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),g(""),y(""),x(""))},[l]);return n(ke,{children:[e(He,{value:h,onChange:f,operators:I}),Ee(h)&&e(Me,{children:e(Te,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0})}),Ne(h)&&n(Me,{children:[e(Te,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e(Te,{type:"number",value:C,onChange:x,placeholder:"To..."})]}),e(Ae,{onApply:function(){var e={accessor:a.accessor,operator:h};Ee(h)?e.value=parseFloat(p):Ne(h)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)},onClear:u,canApply:!!Re(h)||(Ee(h)?""!==p.trim():!!Ne(h)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},Be=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(De,{value:t,onChange:r,options:o,className:a,placeholder:l})},Oe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=Se("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Re(u)||""!==f;return n(ke,{children:[e(He,{value:u,onChange:d,operators:p}),Ee(u)&&e(Me,{children:e(Be,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ae,{onApply:function(){var e={accessor:r.accessor,operator:u};Ee(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:g,showClear:!!i})]})},qe=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],x=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=x[0],S=x[1],E=Se("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),S(""))},[s]);var N=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],g=v[1],w=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(O,m({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e(U,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return n(ke,{children:[e(He,{value:f,onChange:v,operators:E}),Ee(f)&&e(Me,{children:e(N,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ne(f)&&n(Me,{children:[e(N,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(N,{value:I,onChange:S,placeholder:"To date..."})]}),e(Ae,{onApply:function(){var e={accessor:l.accessor,operator:f};Ee(f)?e.value=g:Ne(f)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Re(f)||(Ee(f)?""!==g.trim():!!Ne(f)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},Pe=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ze=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(Pe,{className:"st-checkbox-checkmark"})})),i]}))},je=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1];c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var p=f.length===d.length;return n(ke,{children:[e(Me,{children:n("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(ze,m({checked:p,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(ze,m({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",m({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Ae,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},Ue=function(n){var r=n.header,o=n.currentFilter,i=n.onApplyFilter,a=n.onClearFilter;return e(t,{children:function(){switch(r.type){case"number":return e(Le,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Oe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(qe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(je,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(We,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},Ye=d(function(t,r){var i,a,l=t.colIndex,s=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,h=t.gridRowStart,f=t.header,v=t.reverse,p=t.sort,g=o(!1),w=g[0],y=g[1],x=T(),I=x.columnReordering,S=x.columnResizing,E=x.draggedHeaderRef,N=x.filters,R=x.handleApplyFilter,k=x.handleClearFilter,F=x.headers,D=x.hoveredHeaderRef,H=x.onColumnOrderChange,M=x.onSort,A=x.onTableHeaderDragEnd,W=x.rowHeight,L=x.selectColumns,B=x.selectableColumns,q=x.setHeaders,P=x.setInitialFocusedCell,z=x.setSelectedCells,j=x.setSelectedColumns,U=x.sortDownIcon,Y=x.sortUpIcon,G=Boolean(null==f?void 0:f.isSortable),K=Boolean(null==f?void 0:f.filterable),V=N[f.accessor],X="st-header-cell ".concat(f.accessor===(null===(i=D.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=E.current)||void 0===a?void 0:a.accessor)===f.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(I&&!G?"columnReordering":""," ").concat(f.children?"parent":""),$=re({draggedHeaderRef:E,headers:F,hoveredHeaderRef:D,onColumnOrderChange:H,onTableHeaderDragEnd:A}),Q=$.handleDragStart,Z=$.handleDragEnd,_=$.handleDragOver,ee=J(),ne=function(e){var n=e.event,t=e.header;if(B){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 l=a[i];o=r(l,o)}return o};return r(e,n),t}(t,l);return n.shiftKey&&L?j(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):L&&L(r),z(new Set),void P(null)}t.isSortable&&M(l,t.accessor)};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!f)return null;var te=S&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;ee({callback:ye,callbackProps:{event:e.nativeEvent,gridColumnEnd:s,gridColumnStart:u,header:f,headers:F,setHeaders:q,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;ee({callback:ye,callbackProps:{event:e,gridColumnEnd:s,gridColumnStart:u,header:f,headers:F,setHeaders:q,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),oe=p&&p.key.accessor===f.accessor&&n("div",m({className:"st-icon-container",onClick:function(e){return ne({event:e,header:f})}},{children:["ascending"===p.direction&&Y&&Y,"descending"===p.direction&&U&&U]})),ie=K&&n("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),y(!w)}},{children:[e(xe,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(O,m({open:w,overflow:"visible",setOpen:y,onClose:function(){return y(!1)}},{children:e(Ue,{header:f,currentFilter:V,onApplyFilter:function(e){R(e),y(!1)},onClearFilter:function(){k(f.accessor),y(!1)}})}))]}));return n("div",m({className:X,id:C({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){ee({callback:_,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:r,style:m(m({gridRowStart:h,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:s},s-u>1?{}:{width:f.width}),d-h>1?{}:{height:W})},{children:[v&&te,"right"===f.align&&ie,"right"===f.align&&oe,e("div",m({className:"st-header-label",draggable:I&&!f.disableReorder,onClick:function(e){return ne({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),Z()},onDragStart:function(e){I&&f&&function(e){Q(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:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:l,header:f}):null==f?void 0:f.label}))})),"right"!==f.align&&oe,"right"!==f.align&&ie,!v&&te]}))}),Ge=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,h=n.width,f=a(function(){var e=[],n=1,t=function(o,i,a){var l,u;if(void 0===a&&(a=!1),!x({header:o,pinned:s}))return 0;a||n++;var d=null!==(u=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return x({header:e,pinned:s})}).length)&&void 0!==u?u:0,h=n,f=d>0?h+d:h+1,v=i,p=d>0?i+1:c+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:f,gridRowStart:v,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach(function(e){x({header:e,pinned:s})&&(t(e,i+1,g),g=!1)})}return f-h},o=l.filter(function(e){return x({header:e,pinned:s})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r]);return e(fe,m({condition:!s,wrapper:function(n){return e(he,m({childRef:u},{children:n}))}},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:h}},{children:e(t,{children:f.map(function(n){return e(Ye,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:v(),reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},Ke=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ke)):1},Ve=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headers,l=t.mainTemplateColumns,c=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,h=t.sort,f=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=T(),g=p.pinnedLeftRef,w=p.pinnedRightRef,y=a(function(){return pe({headers:i,pinnedLeftColumns:c,pinnedRightColumns:u})},[i,c,u]),b=a(function(){var e=0;return i.forEach(function(n){if(x({header:n})){var t=Ke(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return n("div",m({className:"st-header-container",ref:o},{children:[Q(i,"left")&&e(Ge,{columnIndices:y,gridTemplateColumns:s,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:g,sort:h,width:f}),e(Ge,{columnIndices:y,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:r,sort:h}),Q(i,"right")&&e(Ge,{columnIndices:y,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:w,sort:h,width:v})]}))},Xe=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Je=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.visibleRows,d=T(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=i(null),g=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return Xe({headers:y})},[y]),x=a(function(){return Xe({headers:w})},[w]),I=a(function(){return Xe({headers:b})},[b]),S={centerHeaderRef:g,headerContainerRef:p,headers:v,mainTemplateColumns:x,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},E={tableRows:s,headerContainerRef:p,mainTemplateColumns:x,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,visibleRows:u};return n("div",m({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(Ve,m({},S)),e(ge,m({},E))]}))},$e=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,h=t.tableBodyContainerRef,f=T().editColumns,v=o(!1),p=v[0],g=v[1],w=i(null),y=h.current&&h.current.scrollHeight>h.current.clientHeight,b=f?28:0,C=(f?d+1:d)+(h.current&&y?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;g(l>e)}}()},1)},[s,l]),p?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===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(he,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},Qe={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 Qe.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?Qe.string(e,n,t):"number"==typeof e&&"number"==typeof n?Qe.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Qe.boolean(e,n,t):Qe.string(String(e),String(n),t)}},Ze=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 b([],e,!0).sort(function(e,t){var r=n.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return Qe.number(i,a,r)}return"date"===t?Qe.date(String(e),String(n),r):"boolean"===t?Qe.boolean(Boolean(e),Boolean(n),r):"enum"===t?Qe.enum(String(e),String(n),r):Qe.string(String(e),String(n),r)}(e[r],t[r],o,i)})},_e=function(e,n,t){return{sortedData:Ze(n,t,e),newSortConfig:t}},en=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(en([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},nn=function(e){return e.every(function(e){return e.hide})},tn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(tn(e.children),nn(e.children)&&(e.hide=!0))})},rn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=T(),p=v.expandIcon,g=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,x=null!=u?u:s.hide||C&&s.children&&nn(s.children);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:C?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(ze,m({checked:x,onChange:function(e){(s.hide=e,e)?tn(i):(en(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,en(i,s.children[0].accessor)));w(b([],g,!0))}},{children:s.label}))]})),C&&h&&s.children&&e("div",m({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(rn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!x||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},on=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return e(rn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},an=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?n("div",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(on,{headers:l,open:d,position:s})]})):null},ln=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},cn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},sn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(ue.Provider,m({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},un=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Ie[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},dn=function(){var t=T(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(t){return n("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:un(t,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},hn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},fn=function(e){var n=e.externalFilterHandling,t=e.rows,r=o({}),i=r[0],c=r[1],s=a(function(){return n||0===Object.keys(i).length?t:t.filter(function(e){return Object.values(i).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=new Date(e),v=new Date(String(r||"")),p=hn(f),g=hn(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return hn(new Date(String(e||"")))}),w=m[0],y=m[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return hn(new Date(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var x=String(e),I=o.includes(x);return"in"===t?I:!I}return!1}var S=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return S===E;case"notEquals":return S!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})})},[n,i,t]),u=l(function(e){c(function(n){var t;return m(m({},n),((t={})[e.accessor]=e,t))})},[]),d=l(function(e){c(function(n){var t=m({},n);return delete t[e],t})},[]),h=l(function(){c({})},[]);return{filters:i,filteredRows:s,handleApplyFilter:u,handleClearFilter:d,handleClearAllFilters:h}},vn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return me(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&Array.isArray(l)){var c=i(l,t+1),s=m({},n);return s[o]=c,e.forEach(function(e){var n=pn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},pn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&Array.isArray(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.filter(function(e){return"number"==typeof e&&!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},gn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(mn,m({},n)):null},mn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,d=void 0!==u&&u,h=t.columnEditorPosition,f=void 0===h?"right":h,v=t.columnEditorText,b=void 0===v?"Columns":v,C=t.columnReordering,x=void 0!==C&&C,E=t.columnResizing,N=void 0!==E&&E,D=t.defaultHeaders,T=t.editColumns,L=void 0!==T&&T,B=t.editColumnsInitOpen,O=void 0!==B&&B,q=t.expandAll,P=void 0===q||q,z=t.expandIcon,j=void 0===z?e(W,{className:"st-expand-icon"}):z,U=t.externalFilterHandling,Y=void 0!==U&&U,G=t.externalSortHandling,K=void 0!==G&&G,V=t.height,X=t.hideFooter,J=void 0!==X&&X,$=t.nextIcon,Q=void 0===$?e(W,{className:"st-next-prev-icon"}):$,Z=t.onCellEdit,_=t.onColumnOrderChange,ee=t.onFilterChange,ne=t.onGridReady,te=t.onNextPage,re=t.onSortChange,oe=t.prevIcon,ie=void 0===oe?e(A,{className:"st-next-prev-icon"}):oe,ae=t.rowGrouping,le=t.rowHeight,ce=void 0===le?32:le,se=t.rowIdAccessor,ue=t.rows,de=t.rowsPerPage,he=void 0===de?10:de,fe=t.selectableCells,ve=void 0!==fe&&fe,pe=t.selectableColumns,ge=void 0!==pe&&pe,me=t.shouldPaginate,we=void 0!==me&&me,ye=t.sortDownIcon,be=void 0===ye?e(ln,{className:"st-header-icon"}):ye,xe=t.sortUpIcon,Ie=void 0===xe?e(cn,{className:"st-header-icon"}):xe,Se=t.tableRef,Ee=t.theme,Ne=void 0===Ee?"light":Ee,Re=t.useHoverRowBackground,ke=void 0===Re||Re,Fe=t.useOddEvenRowBackground,De=void 0===Fe||Fe,He=t.useOddColumnBackground,Te=void 0!==He&&He;Te&&(De=!1);var Me=g(function(e){return e+1},0)[1],Ae=i(null),We=i(null),Le=i(null),Be=i(null),Oe=i(null),qe=i(null),Pe=o(1),ze=Pe[0],je=Pe[1],Ue=o(D),Ye=Ue[0],Ge=Ue[1];c(function(){Ge(D)},[D]);var Ke=o(0),Ve=Ke[0],Xe=Ke[1],Qe=o(0),Ze=Qe[0],en=Qe[1],nn=o(new Set),tn=nn[0],rn=nn[1],on=fn({externalFilterHandling:Y,rows:ue}),un=on.filters,hn=on.filteredRows,pn=on.handleApplyFilter,gn=on.handleClearFilter,mn=on.handleClearAllFilters,wn=l(function(e){pn(e)},[pn]),yn=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,l=e.rowGrouping,c=o(null),s=c[0],u=c[1],d=function(e,n,t,r){var o=_e(t,e,n).sortedData;return r&&0!==r.length?o.map(function(e){var o,i=r[0],a=e[i];if(Array.isArray(a)&&a.length>0){var l=d(a,n,t,r.slice(1));return m(m({},e),((o={})[i]=l,o))}return e}):o},h=a(function(){return r?t:s?l&&l.length>0?d(t,s,n,l):_e(n,t,s).sortedData:t},[t,s,n,r,l]);return{setSort:u,sort:s,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);if(o){var a=null;s&&s.key.accessor===t?"ascending"===s.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},u(a),null==i||i(a)}}}}({headers:Ye,tableRows:hn,externalSortHandling:K,onSortChange:re,rowGrouping:ae}),bn=yn.sort,Cn=yn.sortedRows,xn=yn.updateSort;c(function(){null==ee||ee(un)},[un,ee]),c(function(){null==re||re(bn)},[bn,re]);var In=a(function(){var e=Ce({headers:Ye});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Ye]),Sn=In.mainBodyWidth,En=In.pinnedLeftWidth,Nn=In.pinnedRightWidth;c(function(){null==ne||ne()},[ne]);var Rn=a(function(){if(!we)return Cn;var e=(ze-1)*he,n=e+he;return Cn.slice(e,n)},[ze,he,we,Cn]),kn=vn({rows:Rn,headers:Ye,rowGrouping:ae}),Fn=a(function(){return ae&&0!==ae.length?k({rows:kn,rowGrouping:ae,rowIdAccessor:se,unexpandedRows:tn,expandAll:P}):kn.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[kn,ae,se,tn,P]),Dn=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:V,rowHeight:ce}),Hn=a(function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.tableRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=Math.max(0,i-a*n),c=i+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(r.length,Math.ceil(c/a));return r.slice(s,u)}({bufferRowCount:5,contentHeight:Dn,tableRows:Fn,rowHeight:ce,scrollTop:Ve})},[Dn,ce,Fn,Ve]),Tn=i(new Map),Mn=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=o(new Set),f=h[0],v=h[1],p=o(new Set),g=p[0],m=p[1],b=o(null),C=b[0],x=b[1],I=o(null),E=I[0],N=I[1],k=o(new Set),D=k[0],H=k[1],T=o(new Set),M=T[0],A=T[1],W=i(!1),L=i(null),B=a(function(){return t.flatMap(S)},[t]),O=l(function(){var e=B.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(o),H(new Set(f)),setTimeout(function(){H(new Set)},800))},[B,f,r]),q=l(function(){return w(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(h){switch(h.label){case 0:if(!E)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=B.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=E.rowIndex,l=E.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],g=R(v.row,h,s);if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(m=y)}if(v.row[p.accessor]=m,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(m)}null==u||u({accessor:p.accessor,newValue:m,row:v.row,rowIndex:h});var x=F({colIndex:f,rowIndex:h,rowId:g});o.add(x)}else{var I=F({colIndex:f,rowIndex:h,rowId:g});i.add(I)}}})}),o.size>0&&(H(o),setTimeout(function(){H(new Set)},800)),i.size>0&&(A(i),setTimeout(function(){A(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[E,B,r,s,u,d]),P=l(function(){if(0!==f.size){var e=B.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=R(c.row,a,s);if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(H(t),setTimeout(function(){H(new Set)},800)),o.size>0&&(A(o),setTimeout(function(){A(new Set)},800))}},[f,B,r,s,u,d]),z=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=R(r[c].row,c,s);t.add(F({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),x(null),v(t)},[r,s,m,x,v]),j=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<B.length){var n=F(e);m(new Set),x(null),v(new Set([n])),N(e)}},[B.length,r.length,m,x,v,N]),U=l(function(e,n){void 0===n&&(n=!1),v(new Set),N(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&x(e[e.length-1])},[v,N,m,x]);c(function(){var e=function(e){var t;if(n&&E){var o=E.rowIndex,i=E.colIndex,a=E.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void q();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void P();if(R(null===(t=r[o])||void 0===t?void 0:t.row,o,s)!==a){var l=r.findIndex(function(e,n){return R(e.row,n,s)===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=R(r[o-1].row,o-1,s);j({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=R(r[o+1].row,o+1,s),j({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=R(r[o].row,o,s),j({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<B.length-1&&(c=R(r[o].row,o,s),j({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),m(new Set),x(null),L.current=null,N(null))}else O()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[O,B.length,E,s,z,j,n,r,q,P]);var Y=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=g.has(n);return i||a},[f,g]),G=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?R(r[t-1].row,t-1,s):null,l=r[t+1]?R(r[t+1].row,t+1,s):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!Y(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!Y(u)||g.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),Y(d)||i.push("st-selected-left-border"),Y(h)||i.push("st-selected-right-border"),i.join(" ")},[Y,r,g,s]),K=a(function(){return E?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===E.rowIndex&&t===E.colIndex&&r===E.rowId}:function(){return!1}},[E]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]),X=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return M.has(o)},[M]);return{getBorderClass:G,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(W.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){m(new Set),x(null);var e=F({colIndex:t,rowIndex:r,rowId:o});v(new Set([e])),N({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&W.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=R(r[d].row,d,s);i.add(F({colIndex:h,rowIndex:d,rowId:f}))}v(i)}},handleMouseUp:function(){W.current=!1},isCopyFlashing:V,isWarningFlashing:X,isInitialFocusedCell:K,isSelected:Y,lastSelectedColumnIndex:C,pasteFromClipboard:q,selectColumns:U,selectedCells:f,selectedColumns:g,setInitialFocusedCell:N,setSelectedCells:v,setSelectedColumns:m,deleteSelectedCells:P}}({selectableCells:ve,headers:Ye,tableRows:Fn,rowIdAccessor:se,onCellEdit:Z,cellRegistry:Tn.current}),An=Mn.getBorderClass,Wn=Mn.handleMouseDown,Ln=Mn.handleMouseOver,Bn=Mn.handleMouseUp,On=Mn.isCopyFlashing,qn=Mn.isInitialFocusedCell,Pn=Mn.isSelected,zn=Mn.isWarningFlashing,jn=Mn.selectColumns,Un=Mn.selectedCells,Yn=Mn.selectedColumns,Gn=Mn.setInitialFocusedCell,Kn=Mn.setSelectedCells,Vn=Mn.setSelectedColumns,Xn=l(function(e,n){xn(e,n)},[xn]),Jn=l(function(e){Ge(e)},[]);return function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns;c(function(){var e=function(e){var a=e.target;a.closest(".st-cell")||n&&(a.classList.contains("st-header-cell")||a.classList.contains("st-header-label"))||(t.size>0&&o(new Set),r.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i])}({selectableColumns:ge,selectedCells:Un,selectedColumns:Yn,setSelectedCells:Kn,setSelectedColumns:Vn}),p(function(){if(qe.current){var e=qe.current.offsetWidth-qe.current.clientWidth;en(e)}},[]),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;p(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:Me,tableBodyContainerRef:qe,setScrollbarWidth:en}),c(function(){Se&&(Se.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,r=e.newValue,o=null==ue?void 0:ue[t];if(o){var i=R(o,t,se),a=I({rowId:i,accessor:n}),l=Tn.current.get(a);l&&l.updateContent(r),void 0!==o[n]&&(o[n]=r)}}})},[Se,ue,se]),e(H,m({value:{allowAnimations:s,cellRegistry:Tn.current,cellUpdateFlash:d,columnReordering:x,columnResizing:N,draggedHeaderRef:Ae,editColumns:L,expandIcon:j,unexpandedRows:tn,filters:un,tableRows:Fn,forceUpdate:Me,getBorderClass:An,handleApplyFilter:wn,handleClearFilter:gn,handleClearAllFilters:mn,handleMouseDown:Wn,handleMouseOver:Ln,headers:Ye,hoveredHeaderRef:We,isCopyFlashing:On,isInitialFocusedCell:qn,isSelected:Pn,isWarningFlashing:zn,mainBodyRef:Le,nextIcon:Q,onCellEdit:Z,onColumnOrderChange:_,onSort:Xn,onTableHeaderDragEnd:Jn,pinnedLeftRef:Be,pinnedRightRef:Oe,prevIcon:ie,rowGrouping:ae,rowHeight:ce,rowIdAccessor:se,scrollbarWidth:Ze,selectColumns:jn,selectableColumns:ge,setUnexpandedRows:rn,setHeaders:Ge,setInitialFocusedCell:Gn,setSelectedCells:Kn,setSelectedColumns:Vn,shouldPaginate:we,sortDownIcon:be,sortUpIcon:Ie,tableBodyContainerRef:qe,theme:Ne,useHoverRowBackground:ke,useOddColumnBackground:Te,useOddEvenRowBackground:De}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(Ne),style:V?{height:V}:{}},{children:e(sn,{children:n("div",m({className:"st-wrapper-container"},{children:[e(dn,{}),n("div",m({className:"st-content-wrapper",onMouseUp:Bn,onMouseLeave:Bn},{children:[e(Je,{tableRows:Fn,pinnedLeftWidth:En,pinnedRightWidth:Nn,setScrollTop:Xe,sort:bn,visibleRows:Hn}),e(an,{columnEditorText:b,editColumns:L,editColumnsInitOpen:O,headers:Ye,position:f})]})),e($e,{mainBodyRef:Le,mainBodyWidth:Sn,pinnedLeftWidth:En,pinnedRightWidth:Nn,tableBodyContainerRef:qe}),e(M,{currentPage:ze,hideFooter:J,onPageChange:je,onNextPage:te,shouldPaginate:we,totalPages:Math.ceil(Cn.length/he)})]}))})}))}))};export{gn 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");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=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},o.apply(this,arguments)};function a(e,n,t,r){return new(t||(t=Promise))(function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(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(i,l)}s((r=r.apply(e,n||[])).next())})}function i(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function l(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=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]},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(s({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){f(e)})},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},v=function(e,n,t){return t&&void 0!==e[t]?e[t]:n},p=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,a=e.unexpandedRows,i=e.rowGrouping,l=void 0===i?[]:i,s=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,i){var c=v(t,i,s),f=l[n],h=0===n&&i===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var p=String(c);if((o?!a.has(p):a.has(p))&&n<l.length){var m=function(e,n){var t=e[n];return Array.isArray(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},g=n.createContext(void 0),w=function(n){var t=n.children,r=n.value;return e.jsx(g.Provider,o({value:r},{children:t}))},x=function(){var e=n.useContext(g);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var r=t.currentPage,l=t.hideFooter,s=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=x(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),m=p[0],g=p[1],w=!(r>1),b=!(r<d)&&!c||!m&&r===d;if(l||!u)return null;var C=function(){if(d<=15)return Array.from({length:d},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;else{var a=Math.floor(7);e=r-a,n=r+(o-a-1)}for(var i=e;i<=n;i++)t.push(i);return n<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&s(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return a(void 0,void 0,void 0,function(){var e,n;return i(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return(n<=d||c)&&s(n),[2]}})})},disabled:b},{children:h})),C.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&s(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},C=function(n){var t=n.className;return e.jsx("svg",o({className:t,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"})}))},y=function(n){var t=n.className;return e.jsx("svg",o({className:t,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"})}))},I=function(e){return e.position*(e.rowHeight+1)-1},S=function(e){return e.position*(e.rowHeight+1)},j=function(t){var r=t.children,a=t.onClose,i=t.open,l=t.overflow,s=void 0===l?"auto":l,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=x().mainBodyRef,p=n.useRef(null),m=n.useRef(null),g=n.useState("bottom-left"),w=g[0],b=g[1],C=n.useState({}),y=C[0],I=C[1],S=n.useState(!1),j=S[0],E=S[1];return n.useEffect(function(){i&&p.current?(E(!1),!m.current&&p.current.parentElement&&(m.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&m.current){var e,n=p.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,a=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,i=t.top-e.top,l="bottom",s={};(r>a&&r<=i||r>a&&i>a)&&(l="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===l?s.top=t.bottom+4:s.bottom=window.innerHeight-t.top+4,"left"===c?s.left=t.left:s.right=window.innerWidth-t.right):("bottom"===l?s.top=t.height+4:s.bottom=t.height+4,"left"===c?s.left=0:s.right=0),b("".concat(l,"-").concat(c)),I(s),E(!0)}})):i||E(!1)},[i,u,d,v,h]),n.useEffect(function(){var e=function(e){if(i&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==a||a())}};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,a,c]),n.useEffect(function(){var e=function(e){p.current&&!p.current.contains(e.target)&&(c(!1),null==a||a())};return i&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a,i,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(c(!1),null==a||a())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[a,i,c]),i?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:j?"visible":"hidden"},y),{overflow:s})},{children:r})):null},E=function(n){var t=n.children,r=n.onClick,a=n.isSelected,i=void 0!==a&&a,l=n.disabled,s=void 0!==l&&l,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(s?"disabled":""," ").concat(u),onClick:function(){!s&&r&&r()},role:"option","aria-selected":i,"aria-disabled":s},{children:t}))},R=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.setOpen,s=t.value,c=n.useState(s),u=c[0],d=c[1],f=function(e){d(e),a(e),l(!1),r()};return e.jsxs(j,o({open:i,onClose:function(){r()},setOpen:l,width:120},{children:[e.jsx(E,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(E,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},k=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},N=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},F=function(t){var r,a,i=t.onChange,l=t.onClose,s=t.value,c=x(),u=c.nextIcon,d=c.prevIcon,f=n.useState(s||new Date),h=f[0],v=f[1],p=n.useState("days"),m=p[0],g=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===m&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return g("months")}},{children:[(a=h,a.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===m&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return g("years")}},{children:h.getFullYear()})),"years"===m&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),a=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e);v(n),i(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(a){var c=a===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=a===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth(),e);v(n),i(n),null==l||l()}(a)}},{children:a}),"day-".concat(a)))},m=1;m<=a;m++)p(m);var g=35-(c+a),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e);v(n),i(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;m<=g;m++)x(m);return n}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var a=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),g("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===m&&function(){for(var n=[],t=h.getFullYear(),r=t-6,a=function(r){var a=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(a?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),g("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)a(i);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),i(e),null==l||l()}},{children:"Today"}))}))]}))},D=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],a=new Date;return a.setFullYear(t),a.setMonth(r-1),a.setDate(o),isNaN(a.getTime())?new Date:a},M=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.setOpen,s=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(j,o({open:i,onClose:c,setOpen:l,width:280},{children:e.jsx(F,{value:D(s),onChange:function(e){var n=e.toISOString().split("T")[0];a(n),l(!1),r()},onClose:c})}))},H=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.options,s=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(j,o({open:i,onClose:function(){r()},setOpen:s,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:l.map(function(n){return e.jsx(E,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),a(e),s(!1),void r();var e}},{children:n.label}),n.value)})}))}))},T=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,a=n.setIsEditing,i=n.type,l=void 0===i?"string":i,s=n.value,c=function(){a(!1)};if("boolean"===l&&"boolean"==typeof s)return e.jsx(R,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:a,value:s});if("date"===l)return e.jsx(M,{onBlur:c,onChange:o,open:!0,setOpen:a,value:s});if("enum"===l){var u="string"==typeof s?s:"";return e.jsx(H,{onBlur:c,onChange:o,open:!0,options:r,setOpen:a,value:u})}if("number"===l&&"number"==typeof s)return e.jsx(N,{defaultValue:s,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==s?"":String(s);return e.jsx(k,{defaultValue:d,onBlur:c,onChange:o})},A=0,L=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===A||o-A>=r)&&(A=o,n(t))}},W=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(W);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=W(e[t]));return n},B=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},O=Date.now(),q={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 l(l([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=P(o.children,n,l(l([],t,!0),[r],!1));if(a)return a}}return null},z=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function U(e,n,t){var r,a,i=W(e),l=!1;try{var s=z(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),u=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:i,emergencyBreak:l=!0};var d=i.splice(c,1)[0],f=(r=s,a=o({},d),"left"===r?a.pinned="left":"right"===r?a.pinned="right":delete a.pinned,a),h=u;i.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),l=!0}return{newHeaders:i,emergencyBreak:l}}var Y=function(e){var t,r,o=e.draggedHeaderRef,a=e.headers,i=e.hoveredHeaderRef,s=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,u=x().setHeaders,d=(t=a,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,O=Date.now()},handleDragOver:function(e){var n=e.event,t=e.hoveredHeader;if(n.preventDefault(),a&&o.current){var r=n.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),l=n.screenX,s=n.screenY,u=Math.sqrt(Math.pow(l-q.screenX,2)+Math.pow(s-q.screenY,2));i.current=t;var f,h=o.current,v=!1;if(z(h)!==z(t)){f=(y=U(a,h,t)).newHeaders,v=y.emergencyBreak}else{var p=a,m=P(p,h.accessor),g=P(p,t.accessor);if(!m||!g)return;var w=m.length,x=g.length,b=g;if(w!==x){var C=x-w;C>0&&(b=g.slice(0,-C))}var y=function(e,n,t){var r=W(e),o=!1;function a(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 i(e,n,t){for(var r=e,a=0;a<n.length-1;a++){if(!r[n[a]].children){o=!0;break}r=r[n[a]].children}r[n[n.length-1]]=t}var l=a(r,n);return i(r,n,a(r,t)),i(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,m,b);f=y.newHeaders,v=y.emergencyBreak}if(!(r||t.accessor===h.accessor||u<10||JSON.stringify(f)===JSON.stringify(a)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(d)&&(I-O<1500||u<40)||(O=I,q={screenX:l,screenY:s},c(f))}}},handleDragEnd:function(){o.current=null,i.current=null,setTimeout(function(){u(function(e){return l([],e,!0)}),null==s||s(a)},10)}}},G=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},K=n.forwardRef(function(t,r){var a=t.borderClass,i=t.colIndex,l=t.header,c=t.isHighlighted,d=t.isInitialFocused,f=t.nestedIndex,h=t.rowIndex,p=t.visibleRow,m=x(),g=m.cellRegistry,w=m.cellUpdateFlash,b=m.draggedHeaderRef,C=m.expandIcon,y=m.unexpandedRows,I=m.handleMouseDown,S=m.handleMouseOver,j=m.headers,E=m.hoveredHeaderRef,R=m.isCopyFlashing,k=m.isWarningFlashing,N=m.onCellEdit,F=m.onTableHeaderDragEnd,D=m.rowGrouping,M=m.rowIdAccessor,H=m.setUnexpandedRows,A=m.theme,W=m.useOddColumnBackground,B=p.depth,O=p.row,q=n.useState(O[l.accessor]),P=q[0],z=q[1],U=n.useState(!1),K=U[0],V=U[1],X=n.useState(!1),J=X[0],$=X[1],_=n.useRef(null),Q=v(O,h,M),Z=D&&D[B],ee=!!Z&&function(e,n){if(!n)return!1;var t=e[n];return Array.isArray(t)&&t.length>0}(O,Z),ne=!y.has(String(Q)),te=R({rowIndex:h,colIndex:i,rowId:Q}),re=k({rowIndex:h,colIndex:i,rowId:Q}),oe=Y({draggedHeaderRef:b,headers:j,hoveredHeaderRef:E,onTableHeaderDragEnd:F}).handleDragOver,ae=L(),ie="cell-".concat(h,"-").concat(i),le=u({rowId:Q,accessor:l.accessor});n.useEffect(function(){if(g){var e="".concat(Q,"-").concat(l.accessor);return g.set(e,{updateContent:function(e){P!==e?(z(e),w&&($(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){$(!1)},800))):z(e)}}),function(){g.delete(e),_.current&&clearTimeout(_.current)}}},[g,w,Q,l.accessor,P]),n.useEffect(function(){if(J){var e=setTimeout(function(){$(!1)},850);return function(){return clearTimeout(e)}}},[J]),n.useEffect(function(){z(O[l.accessor])},[O,l.accessor]);var se="boolean"===l.type||"date"===l.type||"enum"===l.type,ce=Boolean(null==l?void 0:l.isEditable),ue="st-cell ".concat(B>0&&l.expandable?"st-cell-depth-".concat(B):""," ").concat(c?d?"st-cell-selected-first ".concat(a):"st-cell-selected ".concat(a):""," ").concat(ce?"clickable":""," ").concat(J?d?"st-cell-updating-first":"st-cell-updating":""," ").concat(te?d?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(re?d?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(W?f%2==0?"even-column":"odd-column":""),de=n.useCallback(function(e){z(e),O[l.accessor]=e,null==N||N({accessor:l.accessor,newValue:e,row:O,rowIndex:h})},[l.accessor,N,O,h]),fe=n.useCallback(function(){H(function(e){var n=new Set(e),t=String(Q);return n.has(t)?n.delete(t):n.add(t),n})},[Q,H]);return K&&!se?e.jsx("div",o({className:"st-cell-editing",id:s({accessor:l.accessor,rowIndex:h+1}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(T,{enumOptions:l.enumOptions,onChange:de,setIsEditing:V,type:l.type,value:P})})):e.jsxs("div",o({className:ue,id:ie,onDoubleClick:function(){return l.isEditable&&V(!0)},onMouseDown:function(){K||I({rowIndex:h,colIndex:i,rowId:Q})},onMouseOver:function(){K||S({rowIndex:h,colIndex:i,rowId:Q})},onDragOver:function(e){return ae({callback:oe,callbackProps:{event:e,hoveredHeader:l},limit:50})},onKeyDown:function(e){K||"F2"!==e.key&&"Enter"!==e.key||!l.isEditable||K||(e.preventDefault(),V(!0))},ref:r,"data-row-index":h,"data-col-index":i,"data-row-id":Q,"data-accessor":l.accessor},{children:[l.expandable&&ee?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(ne?"expanded":"collapsed"),onClick:fe},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===l.align?"right-aligned":"center"===l.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:l.cellRenderer?l.cellRenderer({accessor:l.accessor,colIndex:i,row:O,theme:A}):G({content:P,header:l})})})),K&&se&&e.jsx(T,{enumOptions:l.enumOptions,onChange:de,setIsEditing:V,type:l.type,value:P})]}),le)}),V=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,a=n.pinned,i=n.rowIndex,l=n.rowIndices,u=n.visibleRow,d=o.filter(function(e){return c({header:e,pinned:a})});return e.jsx(e.Fragment,{children:d.map(function(n,c){return e.jsx(X,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:a,rowIndex:i,rowIndices:l,visibleRow:u},s({accessor:n.accessor,rowIndex:i+1}))})})},X=function(t){var r=t.columnIndices,o=t.header,a=t.headers,i=t.nestedIndex,l=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.visibleRow,h=r[o.accessor],p=x(),m=p.getBorderClass,g=p.isSelected,w=p.isInitialFocusedCell,b=p.rowIdAccessor;if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:l})});return e.jsx(n.Fragment,{children:C.map(function(n){return e.jsx(X,{columnIndices:r,header:n,headers:a,nestedIndex:i,pinned:l,rowIndex:u,rowIndices:d,visibleRow:f},s({accessor:n.accessor,rowIndex:u+1}))})})}var y=v(f.row,u,b),I={rowIndex:u,colIndex:h,rowId:y},S=m(I),j=g(I),E=w(I);return e.jsx(K,{borderClass:S,colIndex:h,header:o,isHighlighted:j,isInitialFocused:E,nestedIndex:i,rowIndex:u,visibleRow:f},s({accessor:o.accessor,rowIndex:u+1}))},J=function(n){var t=n.columnIndices,r=n.columnIndexStart,a=n.gridTemplateColumns,i=n.headers,l=n.hoveredIndex,s=n.index,c=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,h=n.visibleRow,v=x().useHoverRowBackground,p=h.position,m=p%2==0;return e.jsx("div",o({className:"st-row ".concat(m?"even":"odd"," ").concat(l===s&&v?"hovered":""),onMouseEnter:function(){f(s)},style:{gridTemplateColumns:a,top:S({position:p,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(V,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:p,rowIndices:d,visibleRow:h},s)}))},$=function(t){var r=t.displayStrongBorder,a=t.position,i=t.rowHeight,l=t.templateColumns,s=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==s){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=l.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=l.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,a=0,i=0;i<r.length;i++){if(t<=o+r[i]){a=i;break}o+=r[i],a=i}var u="cell-".concat(s+1,"-").concat(a+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:l,top:I({position:a,rowHeight:i})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},_=n.createContext(void 0),Q=["default"],Z=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(_);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=o.registerPane,i=o.unregisterPane;return n.useEffect(function(){return t.current&&a(t.current,Q),function(){t.current&&i(t.current,Q)}},[t,a,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},ee=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},ne=function(t){var r=t.columnIndexStart,a=t.columnIndices,i=t.headers,l=t.hoveredIndex,s=t.pinned,c=t.ref,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,p=t.visibleRows,m=t.width,g=s?"st-body-pinned-".concat(s):"st-body-main";return n.useMemo(function(){return B(i,s)},[i,s])?e.jsx(ee,o({condition:!s,wrapper:function(n){return e.jsx(Z,o({childRef:c},{children:n}))}},{children:e.jsx("div",o({className:g,ref:c,style:o({position:"relative",height:"".concat(v,"px"),width:m},!s&&{flexGrow:1})},{children:p.map(function(t,o){return e.jsxs(n.Fragment,{children:[0!==o&&e.jsx($,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:o-1}),e.jsx(J,{columnIndexStart:r,columnIndices:a,gridTemplateColumns:h,headers:i,hoveredIndex:l,index:o,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,visibleRow:t})]},t.position)})}))})):null};function te(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},a=0,i=function(e,n){void 0===n&&(n=!1),n||a++,o[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){i(e,0===n)})};return t.forEach(function(e,n){i(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;i(e,r)}),r.forEach(function(e){i(e,!1)}),o}var re=function(t){var r=t.headerContainerRef,a=t.mainTemplateColumns,i=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,c=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.pinnedRightWidth,f=t.setScrollTop,h=t.tableRows,p=t.visibleRows,m=x(),g=m.headers,w=m.mainBodyRef,b=m.rowHeight,C=m.rowIdAccessor,y=m.scrollbarWidth,I=m.tableBodyContainerRef,S=n.useState(null),j=S[0],E=S[1];!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,a=n.useState(!1),i=a[0],l=a[1];n.useEffect(function(){var e=null==t?void 0:t.current;if(i&&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,i,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;l(e)}};o();var a=new ResizeObserver(function(){o()});return a.observe(n),function(){n&&a.unobserve(n)}}},[t,r])}({headerContainerRef:r,mainSectionRef:I,scrollbarWidth:y});var R=n.useRef(null),k=function(e){return e.length}(h),N=k*(b+1)-1,F=n.useMemo(function(){return te({headers:g,pinnedLeftColumns:i,pinnedRightColumns:c})},[g,i,c]),D=n.useMemo(function(){var e={};return p.forEach(function(n,t){var r=String(v(n.row,t,C));e[r]=t}),e},[p,C]),M={columnIndices:F,headerContainerRef:r,headers:g,hoveredIndex:j,rowHeight:b,rowIndices:D,setHoveredIndex:E,visibleRows:p};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return E(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;R.current&&cancelAnimationFrame(R.current),R.current=requestAnimationFrame(function(){f(n)})},ref:I},{children:[e.jsx(ne,o({},M,{pinned:"left",templateColumns:l,totalHeight:N,width:s})),e.jsx(ne,o({},M,{columnIndexStart:i.length,ref:w,templateColumns:a,totalHeight:N})),e.jsx(ne,o({},M,{columnIndexStart:i.length+a.length,pinned:"right",templateColumns:u,totalHeight:N,width:d}))]}))},oe=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,oe(e.children)),n})},ae=function(e){return void 0===e&&(e=0),e?e+1:0},ie=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,a=e.headers,i=e.setHeaders,s=e.startWidth;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(o&&!o.hide){var v=h(o),p=t-r>1,m=p?d(o):[o],g=function(e){var n="right"===o.pinned?c-e:e-c;if(p&&m.length>1)le({delta:n,leafHeaders:m,minWidth:v,startWidth:s});else{var t=Math.max(s+n,v);o.width=t}a.forEach(function(e){f(e)});var r=l([],a,!0);i(r)};if(u){var w=function(e){var n=e.touches[0];g(n.clientX)},x=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",x)};document.addEventListener("touchmove",w),document.addEventListener("touchend",x)}else{var b=function(e){g(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},le=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,a=t.reduce(function(e,n){return Math.min(e,h(n))},40),i=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(o+n,a)-i;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/i),o=Math.max(n+t,r);e.width=o})},se=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+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(s({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:ae(t),rightWidth:ae(r),mainWidth:o}},ce=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ue={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},de=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},fe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},he=function(e){return["between","notBetween","in","notIn"].includes(e)},ve=function(e){return["isEmpty","isNotEmpty"].includes(e)},pe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},me=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},ge=function(t){var r=t.value,a=t.onChange,i=t.options,l=t.placeholder,s=void 0===l?"Select...":l,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],m=n.useState(-1),g=m[0],w=m[1],x=n.useRef(null),b=i.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<i.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),g>=0&&(a(i[g].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,g,i,a]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=i.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:b?b.label:s})),e.jsx(me,{})]})),e.jsx(j,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===g?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),p(!1),void w(-1);var e}},{children:n.label}),n.value)})}))}))]}))},we=function(n){var t=n.value,r=n.onChange,a=n.operators.map(function(e){return{value:e,label:ue[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(ge,{value:t,onChange:function(e){r(e)},options:a})}))},xe=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,a=n.onChange,i=n.placeholder,l=n.autoFocus,s=void 0!==l&&l,c=n.className,u=void 0===c?"":c;return e.jsx("input",{type:r,value:o,onChange:function(e){return a(e.target.value)},placeholder:i,autoFocus:s,className:"st-filter-input ".concat(u).trim()})},be=function(n){var t=n.children,r=n.className,a=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(a).trim()},{children:t}))},Ce=function(n){var t=n.onApply,r=n.onClear,a=n.canApply,i=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!a,className:"st-filter-button st-filter-button-apply ".concat(a?"":"st-filter-button-disabled")},{children:"Apply"})),i&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},ye=function(t){var r=t.header,a=t.currentFilter,i=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"contains"),c=s[0],u=s[1],d=n.useState(String((null==a?void 0:a.value)||"")),f=d[0],h=d[1],v=de("string");n.useEffect(function(){a?(u(a.operator),h(String(a.value||""))):(u("contains"),h(""))},[a]);var p=ve(c)||f.trim();return e.jsxs(pe,{children:[e.jsx(we,{value:c,onChange:u,operators:v}),fe(c)&&e.jsx(be,{children:e.jsx(xe,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0})}),e.jsx(Ce,{onApply:function(){var e=o({accessor:r.accessor,operator:c},fe(c)&&{value:f});i(e)},onClear:l,canApply:!!p,showClear:!!a})]})},Ie=function(t){var r,o,a=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,c=n.useState((null==i?void 0:i.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==i?void 0:i.values)||void 0===r?void 0:r[0])||"")),m=p[0],g=p[1],w=n.useState(String((null===(o=null==i?void 0:i.values)||void 0===o?void 0:o[1])||"")),x=w[0],b=w[1],C=de("number");n.useEffect(function(){var e,n;i?(d(i.operator),v(String(i.value||"")),g(String((null===(e=i.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=i.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),g(""),b(""))},[i]);return e.jsxs(pe,{children:[e.jsx(we,{value:u,onChange:d,operators:C}),fe(u)&&e.jsx(be,{children:e.jsx(xe,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0})}),he(u)&&e.jsxs(be,{children:[e.jsx(xe,{type:"number",value:m,onChange:g,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(xe,{type:"number",value:x,onChange:b,placeholder:"To..."})]}),e.jsx(Ce,{onApply:function(){var e={accessor:a.accessor,operator:u};fe(u)?e.value=parseFloat(h):he(u)&&(e.values=[parseFloat(m.toString()),parseFloat(x.toString())]),l(e)},onClear:s,canApply:!!ve(u)||(fe(u)?""!==h.trim():!!he(u)&&""!==String(m).trim()&&""!==String(x).trim()),showClear:!!i})]})},Se=function(n){var t=n.value,r=n.onChange,o=n.options,a=n.className,i=void 0===a?"":a,l=n.placeholder;return e.jsx(ge,{value:t,onChange:r,options:o,className:i,placeholder:l})},je=function(t){var r=t.header,o=t.currentFilter,a=t.onApplyFilter,i=t.onClearFilter,l=n.useState((null==o?void 0:o.operator)||"equals"),s=l[0],c=l[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=de("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=ve(s)||""!==d;return e.jsxs(pe,{children:[e.jsx(we,{value:s,onChange:c,operators:h}),fe(s)&&e.jsx(be,{children:e.jsx(Se,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Ce,{onApply:function(){var e={accessor:r.accessor,operator:s};fe(s)&&(e.value="true"===d),a(e)},onClear:i,canApply:v,showClear:!!o})]})},Ee=function(t){var r,a,i=t.header,l=t.currentFilter,s=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==l?void 0:l.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==l?void 0:l.value)?String(l.value):""),v=h[0],p=h[1],m=n.useState((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])?String(l.values[0]):""),g=m[0],w=m[1],x=n.useState(String((null===(a=null==l?void 0:l.values)||void 0===a?void 0:a[1])||"")),b=x[0],C=x[1],y=de("date");n.useEffect(function(){var e,n;l?(f(l.operator),p(String(l.value||"")),w(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),C(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),C(""))},[l]);var I=function(t){var r=t.value,a=t.onChange,i=t.placeholder,l=t.autoFocus,s=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=new Date(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){l&&p.current&&p.current.focus()},[l]);var m=r?new Date(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:i,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(s||""),style:{cursor:"pointer"}}),e.jsx(j,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(F,{value:m,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(pe,{children:[e.jsx(we,{value:d,onChange:f,operators:y}),fe(d)&&e.jsx(be,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),he(d)&&e.jsxs(be,{children:[e.jsx(I,{value:g,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:b,onChange:C,placeholder:"To date..."})]}),e.jsx(Ce,{onApply:function(){var e={accessor:i.accessor,operator:d};fe(d)?e.value=v:he(d)&&(e.values=[g,b]),s(e)},onClear:c,canApply:!!ve(d)||(fe(d)?""!==v.trim():!!he(d)&&""!==g.trim()&&""!==b.trim()),showClear:!!l})]})},Re=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ke=function(n){var t=n.checked,r=void 0!==t&&t,a=n.children,i=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(Re,{className:"st-checkbox-checkmark"})})),a]}))},Ne=function(t){var r=t.header,a=t.currentFilter,i=t.onApplyFilter,s=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==a?void 0:a.values)?a.values.map(String):u),f=d[0],h=d[1];n.useEffect(function(){h(a?a.values?a.values.map(String):[]:u)},[a,u]);var v=f.length===u.length;return e.jsxs(pe,{children:[e.jsx(be,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(ke,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(ke,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):l(l([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e.jsx(Ce,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};i(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==u.length,showClear:!!a})]})},Fe=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,a=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Ie,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"boolean":return e.jsx(je,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"date":return e.jsx(Ee,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"enum":return e.jsx(Ne,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});default:return e.jsx(ye,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a})}}()})},De=n.forwardRef(function(t,r){var a,i,c=t.colIndex,u=t.gridColumnEnd,d=t.gridColumnStart,f=t.gridRowEnd,h=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,g=n.useState(!1),w=g[0],b=g[1],C=x(),y=C.columnReordering,I=C.columnResizing,S=C.draggedHeaderRef,E=C.filters,R=C.handleApplyFilter,k=C.handleClearFilter,N=C.headers,F=C.hoveredHeaderRef,D=C.onColumnOrderChange,M=C.onSort,H=C.onTableHeaderDragEnd,T=C.rowHeight,A=C.selectColumns,W=C.selectableColumns,B=C.setHeaders,O=C.setInitialFocusedCell,q=C.setSelectedCells,P=C.setSelectedColumns,z=C.sortDownIcon,U=C.sortUpIcon,G=Boolean(null==v?void 0:v.isSortable),K=Boolean(null==v?void 0:v.filterable),V=E[v.accessor],X="st-header-cell ".concat(v.accessor===(null===(a=F.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(i=S.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(y&&!G?"columnReordering":""," ").concat(v.children?"parent":""),J=Y({draggedHeaderRef:S,headers:N,hoveredHeaderRef:F,onColumnOrderChange:D,onTableHeaderDragEnd:H}),$=J.handleDragStart,_=J.handleDragEnd,Q=J.handleDragOver,Z=L(),ee=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,a=0,i=e.children;a<i.length;a++){var l=i[a];o=r(l,o)}return o};return r(e,n),t}(t,c);return n.shiftKey&&A?P(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 i,s,c,u,d=l(l([],(i=o,s=n,c=Math.min(i,s),u=Math.max(i,s),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(l(l([],Array.from(e),!0),d,!0))}):A&&A(r),q(new Set),void O(null)}t.isSortable&&M(c,t.accessor)};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var ne=I&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;Z({callback:ie,callbackProps:{event:e.nativeEvent,gridColumnEnd:u,gridColumnStart:d,header:v,headers:N,setHeaders:B,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;Z({callback:ie,callbackProps:{event:e,gridColumnEnd:u,gridColumnStart:d,header:v,headers:N,setHeaders:B,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),te=m&&m.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return ee({event:e,header:v})}},{children:["ascending"===m.direction&&U&&U,"descending"===m.direction&&z&&z]})),re=K&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),b(!w)}},{children:[e.jsx(ce,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(j,o({open:w,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(Fe,{header:v,currentFilter:V,onApplyFilter:function(e){R(e),b(!1)},onClearFilter:function(){k(v.accessor),b(!1)}})}))]}));return e.jsxs("div",o({className:X,id:s({accessor:v.accessor,rowIndex:0}),onDragOver:function(e){Z({callback:Q,callbackProps:{event:e,hoveredHeader:v},limit:50})},ref:r,style:o(o({gridRowStart:h,gridRowEnd:f,gridColumnStart:d,gridColumnEnd:u},u-d>1?{}:{width:v.width}),f-h>1?{}:{height:T})},{children:[p&&ne,"right"===v.align&&re,"right"===v.align&&te,e.jsx("div",o({className:"st-header-label",draggable:y&&!v.disableReorder,onClick:function(e){return ee({event:e,header:v})},onDragEnd:function(e){e.preventDefault(),_()},onDragStart:function(e){y&&v&&function(e){$(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:c,header:v}):null==v?void 0:v.label}))})),"right"!==v.align&&te,"right"!==v.align&&re,!p&&ne]}))}),Me=function(t){var r=t.columnIndices,a=t.gridTemplateColumns,i=t.handleScroll,l=t.headers,s=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,a,i){var l,d;if(void 0===i&&(i=!1),!c({header:o,pinned:u}))return 0;i||n++;var f=null!==(d=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=a,m=f>0?a+1:s+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,a+1,g),g=!1)})}return v-h},o=l.filter(function(e){return c({header:e,pinned:u})}),a=!0;return o.forEach(function(e){t(e,1,a),a=!1}),e},[l,s,u,r]);return e.jsx(ee,o({condition:!u,wrapper:function(n){return e.jsx(Z,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},i&&{onScroll:i},{ref:d,style:{gridTemplateColumns:a,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(t){return e.jsx(De,{colIndex:t.colIndex,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)})})}))}))},He=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(He)):1},Te=function(t){var r=t.centerHeaderRef,a=t.headerContainerRef,i=t.headers,l=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,h=t.sort,v=t.pinnedLeftWidth,p=t.pinnedRightWidth,m=x(),g=m.pinnedLeftRef,w=m.pinnedRightRef,b=n.useMemo(function(){return te({headers:i,pinnedLeftColumns:s,pinnedRightColumns:d})},[i,s,d]),C=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=He(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:a},{children:[B(i,"left")&&e.jsx(Me,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:g,sort:h,width:v}),e.jsx(Me,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:h}),B(i,"right")&&e.jsx(Me,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:w,sort:h,width:p})]}))},Ae=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Le=function(t){var r=t.pinnedLeftWidth,a=t.pinnedRightWidth,i=t.setScrollTop,l=t.sort,s=t.tableRows,c=t.visibleRows,u=x(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=n.useRef(null),m=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),b=n.useMemo(function(){return Ae({headers:g})},[g]),C=n.useMemo(function(){return Ae({headers:m})},[m]),y=n.useMemo(function(){return Ae({headers:w})},[w]),I={centerHeaderRef:p,headerContainerRef:v,headers:h,mainTemplateColumns:C,pinnedLeftColumns:g,pinnedLeftTemplateColumns:b,pinnedRightColumns:w,pinnedRightTemplateColumns:y,sort:l,pinnedLeftWidth:r,pinnedRightWidth:a},S={tableRows:s,headerContainerRef:v,mainTemplateColumns:C,pinnedLeftColumns:g,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:y,pinnedRightWidth:a,setScrollTop:i,visibleRows:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Te,o({},I)),e.jsx(re,o({},S))]}))},We=function(t){var r,a,i=t.mainBodyWidth,l=t.mainBodyRef,s=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=x().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),m=u.current&&u.current.scrollHeight>u.current.clientHeight,g=d?28:0,w=(d?c+1:c)+(u.current&&m?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(l.current){var e=l.current.clientWidth;v(i>e)}}()},1)},[l,i]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),i>0&&e.jsx(Z,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:i,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(a=p.current)||void 0===a?void 0:a.offsetHeight}}),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Be={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 a=r.getTime()-o.getTime();return"ascending"===t?a:-a},enum:function(e,n,t){return Be.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?Be.string(e,n,t):"number"==typeof e&&"number"==typeof n?Be.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Be.boolean(e,n,t):Be.string(String(e),String(n),t)}},Oe=function(e,n,t){var r=t.find(function(e){return e.accessor===n.key.accessor}),o=(null==r?void 0:r.type)||"string",a=n.direction;return l([],e,!0).sort(function(e,t){var r=n.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),a=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===a?o*=1e12:"B"===a?o*=1e9:"M"===a?o*=1e6:"K"===a&&(o*=1e3),o}}return parseFloat(t)||0},a=o(e),i=o(n);return Be.number(a,i,r)}return"date"===t?Be.date(String(e),String(n),r):"boolean"===t?Be.boolean(Boolean(e),Boolean(n),r):"enum"===t?Be.enum(String(e),String(n),r):Be.string(String(e),String(n),r)}(e[r],t[r],o,a)})},qe=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,a=e.onSortChange,i=n.useState(null),l=i[0],s=i[1],c=n.useMemo(function(){if(o)return r;if(!l)return r;var e=function(e,n,t){return{sortedData:Oe(n,t,e),newSortConfig:t}}(t,r,l).sortedData;return e},[r,l,t,o]);return{setSort:s,sort:l,sortedRows:c,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var a=o[t];if(a.accessor===n)return a;if(a.children&&a.children.length>0){var i=r(a.children);if(i)return i}}},o=r(t);if(o){var i=null;l&&l.key.accessor===n?"ascending"===l.direction&&(i={key:o,direction:"descending"}):i={key:o,direction:"ascending"},s(i),null==a||a(i)}}}},Pe=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var a=o[r];if(!t.has(a.accessor)&&(t.add(a.accessor),a.children&&a.children.length>0)){var i=a.children.some(function(e){return e.accessor===n}),l=!1;if(!i)for(var s=0,c=a.children;s<c.length;s++){var u=c[s];if(Pe([u],n,t),!1===u.hide){l=!0;break}}(i||l)&&(a.hide=!1)}}},ze=function(e){return e.every(function(e){return e.hide})},Ue=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Ue(e.children),ze(e.children)&&(e.hide=!0))})},Ye=function(t){var r=t.allHeaders,a=t.depth,i=void 0===a?0:a,s=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=x(),p=v.expandIcon,m=v.headers,g=v.setHeaders,w=s?"".concat(16*i,"px"):"8px",b=c.children&&c.children.length>0,C=null!=u?u:c.hide||b&&c.children&&ze(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[s&&e.jsx("div",o({className:"st-header-icon-container"},{children:b?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(ke,o({checked:C,onChange:function(e){(c.hide=e,e)?Ue(r):(Pe(r,c.accessor),b&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,Pe(r,c.children[0].accessor)));g(l([],m,!0))}},{children:c.label}))]})),b&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(Ye,{allHeaders:r,depth:i+1,doesAnyHeaderHaveChildren:s,header:n,isCheckedOverride:!!C||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Ge=function(t){var r=t.headers,a=t.open,i="left"===t.position?"left":"",l=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(a?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return e.jsx(Ye,{doesAnyHeaderHaveChildren:l,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},Ke=function(t){var r=t.columnEditorText,a=t.editColumns,i=t.editColumnsInitOpen,l=t.headers,s=t.position,c=void 0===s?"right":s,u=n.useState(i),d=u[0],f=u[1];return a?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(Ge,{headers:l,open:d,position:c})]})):null},Ve=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Xe=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},Je=function(t){var a=t.children,i=n.useRef({}),l=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),s=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),s(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});u(n,e)}))})})})}},[c,s]),d=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),l(e,n)||(i.current[n].length>0&&s(i.current[n][0],e),i.current[n].push(e))}),u(e,n)},[l,s,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(l(e,n)){c(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[l,c]);return e.jsx(_.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(a)}))},$e=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ue[e.operator],a="";return void 0!==e.value?a="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?a="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(a=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(a)},_e=function(){var n=x(),t=n.filters,r=n.handleClearFilter,a=n.headers,i=Object.values(t);return 0===i.length||i.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:i.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:$e(n,a)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},Qe=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Ze=function(e){var t=e.externalFilterHandling,r=e.rows,a=n.useState({}),i=a[0],l=a[1],s=n.useMemo(function(){return t||0===Object.keys(i).length?r:r.filter(function(e){return Object.values(i).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var a=String(e).toLowerCase(),i=r?String(r).toLowerCase():"";switch(t){case"equals":return a===i;case"notEquals":return a!==i;case"contains":return a.includes(i);case"notContains":return!a.includes(i);case"startsWith":return a.startsWith(i);case"endsWith":return a.endsWith(i)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),s=Number(r);switch(t){case"equals":return l===s;case"notEquals":return l!==s;case"greaterThan":return l>s;case"lessThan":return l<s;case"greaterThanOrEqual":return l>=s;case"lessThanOrEqual":return l<=s;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=Qe(h),m=Qe(v);switch(t){case"equals":return p.getTime()===m.getTime();case"notEquals":return p.getTime()!==m.getTime();case"before":return p<m;case"after":return p>m;case"between":if(o&&2===o.length){var g=o.map(function(e){return Qe(new Date(String(e||"")))}),w=g[0],x=g[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Qe(new Date(String(e||"")))});return w=b[0],x=b[1],p<w||p>x}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var y=String(e),I=o.includes(y);return"in"===t?I:!I}return!1}var S=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return S===j;case"notEquals":return S!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})})},[t,i,r]),c=n.useCallback(function(e){l(function(n){var t;return o(o({},n),((t={})[e.accessor]=e,t))})},[]),u=n.useCallback(function(e){l(function(n){var t=o({},n);return delete t[e],t})},[]),d=n.useCallback(function(){l({})},[]);return{filters:i,filteredRows:s,handleApplyFilter:c,handleClearFilter:u,handleClearAllFilters:d}},en=function(e){var t=e.rows,r=e.headers,a=e.rowGrouping;return n.useMemo(function(){if(!a||0===a.length)return t;var e=function(e){return oe(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=a[t],l=a[t+1],s=n[r];if(s&&Array.isArray(s)){var c=i(s,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=nn(c,e.accessor,e.aggregation,l);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return i(n)},[t,r,a])},nn=function(e,n,t,r){var o=[],a=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&Array.isArray(t)?a(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(a(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var i,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.filter(function(e){return"number"==typeof e&&!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":i=l.reduce(function(e,n){return e+n},0);break;case"average":i=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":i=o.length;break;case"min":i=Math.min.apply(Math,l);break;case"max":i=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(i):i}},tn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,s=t.cellUpdateFlash,c=void 0!==s&&s,f=t.columnEditorPosition,h=void 0===f?"right":f,g=t.columnEditorText,x=void 0===g?"Columns":g,I=t.columnReordering,S=void 0!==I&&I,j=t.columnResizing,E=void 0!==j&&j,R=t.defaultHeaders,k=t.editColumns,N=void 0!==k&&k,F=t.editColumnsInitOpen,D=void 0!==F&&F,M=t.expandAll,H=void 0===M||M,T=t.expandIcon,A=void 0===T?e.jsx(y,{className:"st-expand-icon"}):T,L=t.externalFilterHandling,W=void 0!==L&&L,B=t.externalSortHandling,O=void 0!==B&&B,q=t.height,P=t.hideFooter,z=void 0!==P&&P,U=t.nextIcon,Y=void 0===U?e.jsx(y,{className:"st-next-prev-icon"}):U,G=t.onCellEdit,K=t.onColumnOrderChange,V=t.onFilterChange,X=t.onGridReady,J=t.onNextPage,$=t.onSortChange,_=t.prevIcon,Q=void 0===_?e.jsx(C,{className:"st-next-prev-icon"}):_,Z=t.rowGrouping,ee=t.rowHeight,ne=void 0===ee?32:ee,te=t.rowIdAccessor,re=t.rows,oe=t.rowsPerPage,ae=void 0===oe?10:oe,ie=t.selectableCells,le=void 0!==ie&&ie,ce=t.selectableColumns,ue=void 0!==ce&&ce,de=t.shouldPaginate,fe=void 0!==de&&de,he=t.sortDownIcon,ve=void 0===he?e.jsx(Ve,{className:"st-header-icon"}):he,pe=t.sortUpIcon,me=void 0===pe?e.jsx(Xe,{className:"st-header-icon"}):pe,ge=t.tableRef,we=t.theme,xe=void 0===we?"light":we,be=t.useHoverRowBackground,Ce=void 0===be||be,ye=t.useOddEvenRowBackground,Ie=void 0===ye||ye,Se=t.useOddColumnBackground,je=void 0!==Se&&Se;je&&(Ie=!1);var Ee=n.useReducer(function(e){return e+1},0)[1],Re=n.useRef(null),ke=n.useRef(null),Ne=n.useRef(null),Fe=n.useRef(null),De=n.useRef(null),Me=n.useRef(null),He=n.useState(1),Te=He[0],Ae=He[1],Be=n.useState(R),Oe=Be[0],Pe=Be[1];n.useEffect(function(){Pe(R)},[R]);var ze=n.useState(0),Ue=ze[0],Ye=ze[1],Ge=n.useState(0),$e=Ge[0],Qe=Ge[1],nn=n.useState(new Set),tn=nn[0],rn=nn[1],on=Ze({externalFilterHandling:W,rows:re}),an=on.filters,ln=on.filteredRows,sn=on.handleApplyFilter,cn=on.handleClearFilter,un=on.handleClearAllFilters,dn=n.useCallback(function(e){sn(e)},[sn]),fn=qe({headers:Oe,tableRows:ln,externalSortHandling:O,onSortChange:$}),hn=fn.sort,vn=fn.sortedRows,pn=fn.updateSort;n.useEffect(function(){null==V||V(an)},[an,V]),n.useEffect(function(){null==$||$(hn)},[hn,$]);var mn=n.useMemo(function(){var e=se({headers:Oe});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Oe]),gn=mn.mainBodyWidth,wn=mn.pinnedLeftWidth,xn=mn.pinnedRightWidth;n.useEffect(function(){null==X||X()},[X]);var bn=n.useMemo(function(){if(!fe)return vn;var e=(Te-1)*ae,n=e+ae;return vn.slice(e,n)},[Te,ae,fe,vn]),Cn=en({rows:bn,headers:Oe,rowGrouping:Z}),yn=n.useMemo(function(){return Z&&0!==Z.length?p({rows:Cn,rowGrouping:Z,rowIdAccessor:te,unexpandedRows:tn,expandAll:H}):Cn.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[Cn,Z,te,tn,H]),In=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var a=parseInt(t,10);o=window.innerHeight*a/100}else if(t.endsWith("%")){var i=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*i/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:q,rowHeight:ne}),Sn=n.useMemo(function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.tableRows,o=e.rowHeight,a=e.scrollTop,i=o+1,l=Math.max(0,a-i*n),s=a+t+i*n,c=Math.max(0,Math.floor(l/i)),u=Math.min(r.length,Math.ceil(s/i));return r.slice(c,u)}({bufferRowCount:5,contentHeight:In,tableRows:yn,rowHeight:ne,scrollTop:Ue})},[In,ne,yn,Ue]),jn=n.useRef(new Map),En=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,l=e.rowIdAccessor,s=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],p=n.useState(new Set),g=p[0],w=p[1],x=n.useState(null),b=x[0],C=x[1],y=n.useState(null),I=y[0],S=y[1],j=n.useState(new Set),E=j[0],R=j[1],k=n.useState(new Set),N=k[0],F=k[1],D=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){return r.flatMap(d)},[r]),T=n.useCallback(function(){var e=H.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,a=t.split("-").map(Number),i=a[0],l=a[1];e[i]||(e[i]=[]);var s=n.get(l);return s&&(null===(r=o[i])||void 0===r?void 0:r.row)?e[i][l]=o[i].row[s]:e[i][l]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),R(new Set(f)),setTimeout(function(){R(new Set)},800))},[H,f,o]),A=n.useCallback(function(){return a(void 0,void 0,void 0,function(){var e,n,t,r,a,u,d,f;return i(this,function(i){switch(i.label){case 0:if(!I)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=i.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=H.filter(function(e){return!e.hide}),r=new Set,a=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,i){var f=u+n,h=d+i;if(!(f>=o.length||h>=t.length)){var p=o[f],g=t[h],w=v(p.row,f,l);if(null==g?void 0:g.isEditable){var x=e;if("number"===g.type){var b=Number(e);isNaN(b)||(x=b)}else if("boolean"===g.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===g.type){var C=new Date(e);isNaN(C.getTime())||(x=C)}if(p.row[g.accessor]=x,c){var y="".concat(w,"-").concat(g.accessor),I=c.get(y);I&&I.updateContent(x)}null==s||s({accessor:g.accessor,newValue:x,row:p.row,rowIndex:f});var S=m({colIndex:h,rowIndex:f,rowId:w});r.add(S)}else{var j=m({colIndex:h,rowIndex:f,rowId:w});a.add(j)}}})}),r.size>0&&(R(r),setTimeout(function(){R(new Set)},800)),a.size>0&&(F(a),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=i.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,H,o,l,s,c]),L=n.useCallback(function(){if(0!==f.size){var e=H.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var a=n.split("-").map(Number),i=a[0],u=a[1];if(!(i>=o.length||u>=e.length)){var d=o[i],f=e[u],h=v(d.row,i,l);if(null==f?void 0:f.isEditable){var p=null;if(p="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:""),d.row[f.accessor]=p,c){var m="".concat(h,"-").concat(f.accessor),g=c.get(m);g&&g.updateContent(p)}null==s||s({accessor:f.accessor,newValue:p,row:d.row,rowIndex:i}),t.add(n)}else r.add(n)}}),t.size>0&&(R(t),setTimeout(function(){R(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,H,o,l,s,c]),W=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),a=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),c=r;c<=a;c++)for(var u=i;u<=s;u++)if(c>=0&&c<o.length){var d=v(o[c].row,c,l);t.add(m({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),C(null),h(t)},[o,l,w,C,h]),B=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<H.length){var n=m(e);w(new Set),C(null),h(new Set([n])),S(e)}},[H.length,o.length,w,C,h,S]),O=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),S(null),w(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&C(e[e.length-1])},[h,S,w,C]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,a=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void A();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void L();if(v(null===(n=o[r])||void 0===n?void 0:n.row,r,l)!==i){var s=o.findIndex(function(e,n){return v(e.row,n,l)===i});if(-1===s)return;r=s}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=v(o[r-1].row,r-1,l);B({rowIndex:r-1,colIndex:a,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=v(o[r+1].row,r+1,l),B({rowIndex:r+1,colIndex:a,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),a>0&&(c=v(o[r].row,r,l),B({rowIndex:r,colIndex:a-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),a<H.length-1&&(c=v(o[r].row,r,l),B({rowIndex:r,colIndex:a+1,rowId:c}))):"Escape"===e.key&&(h(new Set),w(new Set),C(null),M.current=null,S(null))}else T()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[T,H.length,I,l,W,B,t,o,A,L]);var q=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),a=f.has(o),i=g.has(n);return a||i},[f,g]),P=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,a=[],i=o[t-1]?v(o[t-1].row,t-1,l):null,s=o[t+1]?v(o[t+1].row,t+1,l):null,c=null!==i?{colIndex:n,rowIndex:t-1,rowId:i}:null,u=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!q(c)||g.has(n)&&0===t)&&a.push("st-selected-top-border"),(!u||!q(u)||g.has(n)&&t===o.length-1)&&a.push("st-selected-bottom-border"),q(d)||a.push("st-selected-left-border"),q(f)||a.push("st-selected-right-border"),a.join(" ")},[q,o,g,l]),z=n.useMemo(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]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:P,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(D.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){w(new Set),C(null);var e=m({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),S({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&D.current&&M.current){for(var a=new Set,i=Math.min(M.current.rowIndex,r),s=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=i;d<=s;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var p=v(o[d].row,d,l);a.add(m({colIndex:f,rowIndex:d,rowId:p}))}h(a)}},handleMouseUp:function(){D.current=!1},isCopyFlashing:U,isWarningFlashing:Y,isInitialFocusedCell:z,isSelected:q,lastSelectedColumnIndex:b,pasteFromClipboard:A,selectColumns:O,selectedCells:f,selectedColumns:g,setInitialFocusedCell:S,setSelectedCells:h,setSelectedColumns:w,deleteSelectedCells:L}}({selectableCells:le,headers:Oe,tableRows:yn,rowIdAccessor:te,onCellEdit:G,cellRegistry:jn.current}),Rn=En.getBorderClass,kn=En.handleMouseDown,Nn=En.handleMouseOver,Fn=En.handleMouseUp,Dn=En.isCopyFlashing,Mn=En.isInitialFocusedCell,Hn=En.isSelected,Tn=En.isWarningFlashing,An=En.selectColumns,Ln=En.selectedCells,Wn=En.selectedColumns,Bn=En.setInitialFocusedCell,On=En.setSelectedCells,qn=En.setSelectedColumns,Pn=n.useCallback(function(e,n){pn(e,n)},[pn]),zn=n.useCallback(function(e){Pe(e)},[]);return function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,a=e.setSelectedCells,i=e.setSelectedColumns;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(r.size>0&&a(new Set),o.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,a,i])}({selectableColumns:ue,selectedCells:Ln,selectedColumns:Wn,setSelectedCells:On,setSelectedColumns:qn}),n.useLayoutEffect(function(){if(Me.current){var e=Me.current.offsetWidth-Me.current.clientWidth;Qe(e)}},[]),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:Ee,tableBodyContainerRef:Me,setScrollbarWidth:Qe}),n.useEffect(function(){ge&&(ge.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,r=e.newValue,o=null==re?void 0:re[t];if(o){var a=v(o,t,te),i=u({rowId:a,accessor:n}),l=jn.current.get(i);l&&l.updateContent(r),void 0!==o[n]&&(o[n]=r)}}})},[ge,re,te]),e.jsx(w,o({value:{allowAnimations:l,cellRegistry:jn.current,cellUpdateFlash:c,columnReordering:S,columnResizing:E,draggedHeaderRef:Re,editColumns:N,expandIcon:A,unexpandedRows:tn,filters:an,tableRows:yn,forceUpdate:Ee,getBorderClass:Rn,handleApplyFilter:dn,handleClearFilter:cn,handleClearAllFilters:un,handleMouseDown:kn,handleMouseOver:Nn,headers:Oe,hoveredHeaderRef:ke,isCopyFlashing:Dn,isInitialFocusedCell:Mn,isSelected:Hn,isWarningFlashing:Tn,mainBodyRef:Ne,nextIcon:Y,onCellEdit:G,onColumnOrderChange:K,onSort:Pn,onTableHeaderDragEnd:zn,pinnedLeftRef:Fe,pinnedRightRef:De,prevIcon:Q,rowGrouping:Z,rowHeight:ne,rowIdAccessor:te,scrollbarWidth:$e,selectColumns:An,selectableColumns:ue,setUnexpandedRows:rn,setHeaders:Pe,setInitialFocusedCell:Bn,setSelectedCells:On,setSelectedColumns:qn,shouldPaginate:fe,sortDownIcon:ve,sortUpIcon:me,tableBodyContainerRef:Me,theme:xe,useHoverRowBackground:Ce,useOddColumnBackground:je,useOddEvenRowBackground:Ie}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(xe),style:q?{height:q}:{}},{children:e.jsx(Je,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(_e,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Fn,onMouseLeave:Fn},{children:[e.jsx(Le,{tableRows:yn,pinnedLeftWidth:wn,pinnedRightWidth:xn,setScrollTop:Ye,sort:hn,visibleRows:Sn}),e.jsx(Ke,{columnEditorText:x,editColumns:N,editColumnsInitOpen:D,headers:Oe,position:h})]})),e.jsx(We,{mainBodyRef:Ne,mainBodyWidth:gn,pinnedLeftWidth:wn,pinnedRightWidth:xn,tableBodyContainerRef:Me}),e.jsx(b,{currentPage:Te,hideFooter:z,onPageChange:Ae,onNextPage:J,shouldPaginate:fe,totalPages:Math.ceil(vn.length/ae)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),a=r[0],i=r[1];return n.useEffect(function(){i(!0)},[]),a?e.jsx(tn,o({},t)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=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},o.apply(this,arguments)};function a(e,n,t,r){return new(t||(t=Promise))(function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(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(i,l)}s((r=r.apply(e,n||[])).next())})}function i(e,n){var t,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function l(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=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]},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(s({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){f(e)})},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},v=function(e,n,t){return t&&void 0!==e[t]?e[t]:n},p=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,a=e.unexpandedRows,i=e.rowGrouping,l=void 0===i?[]:i,s=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,i){var c=v(t,i,s),f=l[n],h=0===n&&i===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var p=String(c);if((o?!a.has(p):a.has(p))&&n<l.length){var m=function(e,n){var t=e[n];return Array.isArray(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},g=n.createContext(void 0),w=function(n){var t=n.children,r=n.value;return e.jsx(g.Provider,o({value:r},{children:t}))},x=function(){var e=n.useContext(g);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var r=t.currentPage,l=t.hideFooter,s=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=x(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),m=p[0],g=p[1],w=!(r>1),b=!(r<d)&&!c||!m&&r===d;if(l||!u)return null;var C=function(){if(d<=15)return Array.from({length:d},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=d-Math.floor(7.5))e=Math.max(1,d-o+1),n=d;else{var a=Math.floor(7);e=r-a,n=r+(o-a-1)}for(var i=e;i<=n;i++)t.push(i);return n<d-1&&(t.push(-1),t.push(d)),t}();return e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&s(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return a(void 0,void 0,void 0,function(){var e,n;return i(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return g(!1),[2];t.label=2;case 2:return(n<=d||c)&&s(n),[2]}})})},disabled:b},{children:h})),C.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&s(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},C=function(n){var t=n.className;return e.jsx("svg",o({className:t,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"})}))},y=function(n){var t=n.className;return e.jsx("svg",o({className:t,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"})}))},I=function(e){return e.position*(e.rowHeight+1)-1},S=function(e){return e.position*(e.rowHeight+1)},j=function(t){var r=t.children,a=t.onClose,i=t.open,l=t.overflow,s=void 0===l?"auto":l,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=x().mainBodyRef,p=n.useRef(null),m=n.useRef(null),g=n.useState("bottom-left"),w=g[0],b=g[1],C=n.useState({}),y=C[0],I=C[1],S=n.useState(!1),j=S[0],E=S[1];return n.useEffect(function(){i&&p.current?(E(!1),!m.current&&p.current.parentElement&&(m.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&m.current){var e,n=p.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,a=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,i=t.top-e.top,l="bottom",s={};(r>a&&r<=i||r>a&&i>a)&&(l="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===l?s.top=t.bottom+4:s.bottom=window.innerHeight-t.top+4,"left"===c?s.left=t.left:s.right=window.innerWidth-t.right):("bottom"===l?s.top=t.height+4:s.bottom=t.height+4,"left"===c?s.left=0:s.right=0),b("".concat(l,"-").concat(c)),I(s),E(!0)}})):i||E(!1)},[i,u,d,v,h]),n.useEffect(function(){var e=function(e){if(i&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==a||a())}};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,a,c]),n.useEffect(function(){var e=function(e){p.current&&!p.current.contains(e.target)&&(c(!1),null==a||a())};return i&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a,i,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(c(!1),null==a||a())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[a,i,c]),i?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:j?"visible":"hidden"},y),{overflow:s})},{children:r})):null},E=function(n){var t=n.children,r=n.onClick,a=n.isSelected,i=void 0!==a&&a,l=n.disabled,s=void 0!==l&&l,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(s?"disabled":""," ").concat(u),onClick:function(){!s&&r&&r()},role:"option","aria-selected":i,"aria-disabled":s},{children:t}))},R=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.setOpen,s=t.value,c=n.useState(s),u=c[0],d=c[1],f=function(e){d(e),a(e),l(!1),r()};return e.jsxs(j,o({open:i,onClose:function(){r()},setOpen:l,width:120},{children:[e.jsx(E,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(E,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},k=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;a(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},N=function(t){var r=t.defaultValue,o=t.onBlur,a=t.onChange,i=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:i,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&a(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},F=function(t){var r,a,i=t.onChange,l=t.onClose,s=t.value,c=x(),u=c.nextIcon,d=c.prevIcon,f=n.useState(s||new Date),h=f[0],v=f[1],p=n.useState("days"),m=p[0],g=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===m&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return g("months")}},{children:[(a=h,a.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===m&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return g("years")}},{children:h.getFullYear()})),"years"===m&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),a=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e);v(n),i(n),null==l||l()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(a){var c=a===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=a===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth(),e);v(n),i(n),null==l||l()}(a)}},{children:a}),"day-".concat(a)))},m=1;m<=a;m++)p(m);var g=35-(c+a),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e);v(n),i(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;m<=g;m++)x(m);return n}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var a=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),g("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===m&&function(){for(var n=[],t=h.getFullYear(),r=t-6,a=function(r){var a=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(a?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),g("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)a(i);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),i(e),null==l||l()}},{children:"Today"}))}))]}))},D=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],a=new Date;return a.setFullYear(t),a.setMonth(r-1),a.setDate(o),isNaN(a.getTime())?new Date:a},M=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.setOpen,s=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(j,o({open:i,onClose:c,setOpen:l,width:280},{children:e.jsx(F,{value:D(s),onChange:function(e){var n=e.toISOString().split("T")[0];a(n),l(!1),r()},onClose:c})}))},H=function(t){var r=t.onBlur,a=t.onChange,i=t.open,l=t.options,s=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(j,o({open:i,onClose:function(){r()},setOpen:s,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:l.map(function(n){return e.jsx(E,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),a(e),s(!1),void r();var e}},{children:n.label}),n.value)})}))}))},T=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,a=n.setIsEditing,i=n.type,l=void 0===i?"string":i,s=n.value,c=function(){a(!1)};if("boolean"===l&&"boolean"==typeof s)return e.jsx(R,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:a,value:s});if("date"===l)return e.jsx(M,{onBlur:c,onChange:o,open:!0,setOpen:a,value:s});if("enum"===l){var u="string"==typeof s?s:"";return e.jsx(H,{onBlur:c,onChange:o,open:!0,options:r,setOpen:a,value:u})}if("number"===l&&"number"==typeof s)return e.jsx(N,{defaultValue:s,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==s?"":String(s);return e.jsx(k,{defaultValue:d,onBlur:c,onChange:o})},A=0,L=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===A||o-A>=r)&&(A=o,n(t))}},W=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(W);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=W(e[t]));return n},B=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},O=Date.now(),q={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 l(l([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=P(o.children,n,l(l([],t,!0),[r],!1));if(a)return a}}return null},z=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function U(e,n,t){var r,a,i=W(e),l=!1;try{var s=z(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),u=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:i,emergencyBreak:l=!0};var d=i.splice(c,1)[0],f=(r=s,a=o({},d),"left"===r?a.pinned="left":"right"===r?a.pinned="right":delete a.pinned,a),h=u;i.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),l=!0}return{newHeaders:i,emergencyBreak:l}}var Y=function(e){var t,r,o=e.draggedHeaderRef,a=e.headers,i=e.hoveredHeaderRef,s=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,u=x().setHeaders,d=(t=a,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,O=Date.now()},handleDragOver:function(e){var n=e.event,t=e.hoveredHeader;if(n.preventDefault(),a&&o.current){var r=n.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),l=n.screenX,s=n.screenY,u=Math.sqrt(Math.pow(l-q.screenX,2)+Math.pow(s-q.screenY,2));i.current=t;var f,h=o.current,v=!1;if(z(h)!==z(t)){f=(y=U(a,h,t)).newHeaders,v=y.emergencyBreak}else{var p=a,m=P(p,h.accessor),g=P(p,t.accessor);if(!m||!g)return;var w=m.length,x=g.length,b=g;if(w!==x){var C=x-w;C>0&&(b=g.slice(0,-C))}var y=function(e,n,t){var r=W(e),o=!1;function a(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 i(e,n,t){for(var r=e,a=0;a<n.length-1;a++){if(!r[n[a]].children){o=!0;break}r=r[n[a]].children}r[n[n.length-1]]=t}var l=a(r,n);return i(r,n,a(r,t)),i(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,m,b);f=y.newHeaders,v=y.emergencyBreak}if(!(r||t.accessor===h.accessor||u<10||JSON.stringify(f)===JSON.stringify(a)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(d)&&(I-O<1500||u<40)||(O=I,q={screenX:l,screenY:s},c(f))}}},handleDragEnd:function(){o.current=null,i.current=null,setTimeout(function(){u(function(e){return l([],e,!0)}),null==s||s(a)},10)}}},G=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},K=n.forwardRef(function(t,r){var a=t.borderClass,i=t.colIndex,l=t.header,c=t.isHighlighted,d=t.isInitialFocused,f=t.nestedIndex,h=t.rowIndex,p=t.visibleRow,m=x(),g=m.cellRegistry,w=m.cellUpdateFlash,b=m.draggedHeaderRef,C=m.expandIcon,y=m.unexpandedRows,I=m.handleMouseDown,S=m.handleMouseOver,j=m.headers,E=m.hoveredHeaderRef,R=m.isCopyFlashing,k=m.isWarningFlashing,N=m.onCellEdit,F=m.onTableHeaderDragEnd,D=m.rowGrouping,M=m.rowIdAccessor,H=m.setUnexpandedRows,A=m.theme,W=m.useOddColumnBackground,B=p.depth,O=p.row,q=n.useState(O[l.accessor]),P=q[0],z=q[1],U=n.useState(!1),K=U[0],V=U[1],X=n.useState(!1),J=X[0],$=X[1],_=n.useRef(null),Q=v(O,h,M),Z=D&&D[B],ee=!!Z&&function(e,n){if(!n)return!1;var t=e[n];return Array.isArray(t)&&t.length>0}(O,Z),ne=!y.has(String(Q)),te=R({rowIndex:h,colIndex:i,rowId:Q}),re=k({rowIndex:h,colIndex:i,rowId:Q}),oe=Y({draggedHeaderRef:b,headers:j,hoveredHeaderRef:E,onTableHeaderDragEnd:F}).handleDragOver,ae=L(),ie="cell-".concat(h,"-").concat(i),le=u({rowId:Q,accessor:l.accessor});n.useEffect(function(){if(g){var e="".concat(Q,"-").concat(l.accessor);return g.set(e,{updateContent:function(e){P!==e?(z(e),w&&($(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(function(){$(!1)},800))):z(e)}}),function(){g.delete(e),_.current&&clearTimeout(_.current)}}},[g,w,Q,l.accessor,P]),n.useEffect(function(){if(J){var e=setTimeout(function(){$(!1)},850);return function(){return clearTimeout(e)}}},[J]),n.useEffect(function(){z(O[l.accessor])},[O,l.accessor]);var se="boolean"===l.type||"date"===l.type||"enum"===l.type,ce=Boolean(null==l?void 0:l.isEditable),ue="st-cell ".concat(B>0&&l.expandable?"st-cell-depth-".concat(B):""," ").concat(c?d?"st-cell-selected-first ".concat(a):"st-cell-selected ".concat(a):""," ").concat(ce?"clickable":""," ").concat(J?d?"st-cell-updating-first":"st-cell-updating":""," ").concat(te?d?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(re?d?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(W?f%2==0?"even-column":"odd-column":""),de=n.useCallback(function(e){z(e),O[l.accessor]=e,null==N||N({accessor:l.accessor,newValue:e,row:O,rowIndex:h})},[l.accessor,N,O,h]),fe=n.useCallback(function(){H(function(e){var n=new Set(e),t=String(Q);return n.has(t)?n.delete(t):n.add(t),n})},[Q,H]);return K&&!se?e.jsx("div",o({className:"st-cell-editing",id:s({accessor:l.accessor,rowIndex:h+1}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(T,{enumOptions:l.enumOptions,onChange:de,setIsEditing:V,type:l.type,value:P})})):e.jsxs("div",o({className:ue,id:ie,onDoubleClick:function(){return l.isEditable&&V(!0)},onMouseDown:function(){K||I({rowIndex:h,colIndex:i,rowId:Q})},onMouseOver:function(){K||S({rowIndex:h,colIndex:i,rowId:Q})},onDragOver:function(e){return ae({callback:oe,callbackProps:{event:e,hoveredHeader:l},limit:50})},onKeyDown:function(e){K||"F2"!==e.key&&"Enter"!==e.key||!l.isEditable||K||(e.preventDefault(),V(!0))},ref:r,"data-row-index":h,"data-col-index":i,"data-row-id":Q,"data-accessor":l.accessor},{children:[l.expandable&&ee?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(ne?"expanded":"collapsed"),onClick:fe},{children:C})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===l.align?"right-aligned":"center"===l.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:l.cellRenderer?l.cellRenderer({accessor:l.accessor,colIndex:i,row:O,theme:A}):G({content:P,header:l})})})),K&&se&&e.jsx(T,{enumOptions:l.enumOptions,onChange:de,setIsEditing:V,type:l.type,value:P})]}),le)}),V=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,a=n.pinned,i=n.rowIndex,l=n.rowIndices,u=n.visibleRow,d=o.filter(function(e){return c({header:e,pinned:a})});return e.jsx(e.Fragment,{children:d.map(function(n,c){return e.jsx(X,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:a,rowIndex:i,rowIndices:l,visibleRow:u},s({accessor:n.accessor,rowIndex:i+1}))})})},X=function(t){var r=t.columnIndices,o=t.header,a=t.headers,i=t.nestedIndex,l=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.visibleRow,h=r[o.accessor],p=x(),m=p.getBorderClass,g=p.isSelected,w=p.isInitialFocusedCell,b=p.rowIdAccessor;if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:l})});return e.jsx(n.Fragment,{children:C.map(function(n){return e.jsx(X,{columnIndices:r,header:n,headers:a,nestedIndex:i,pinned:l,rowIndex:u,rowIndices:d,visibleRow:f},s({accessor:n.accessor,rowIndex:u+1}))})})}var y=v(f.row,u,b),I={rowIndex:u,colIndex:h,rowId:y},S=m(I),j=g(I),E=w(I);return e.jsx(K,{borderClass:S,colIndex:h,header:o,isHighlighted:j,isInitialFocused:E,nestedIndex:i,rowIndex:u,visibleRow:f},s({accessor:o.accessor,rowIndex:u+1}))},J=function(n){var t=n.columnIndices,r=n.columnIndexStart,a=n.gridTemplateColumns,i=n.headers,l=n.hoveredIndex,s=n.index,c=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,h=n.visibleRow,v=x().useHoverRowBackground,p=h.position,m=p%2==0;return e.jsx("div",o({className:"st-row ".concat(m?"even":"odd"," ").concat(l===s&&v?"hovered":""),onMouseEnter:function(){f(s)},style:{gridTemplateColumns:a,top:S({position:p,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(V,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:p,rowIndices:d,visibleRow:h},s)}))},$=function(t){var r=t.displayStrongBorder,a=t.position,i=t.rowHeight,l=t.templateColumns,s=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==s){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=l.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=l.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,a=0,i=0;i<r.length;i++){if(t<=o+r[i]){a=i;break}o+=r[i],a=i}var u="cell-".concat(s+1,"-").concat(a+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:l,top:I({position:a,rowHeight:i})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},_=n.createContext(void 0),Q=["default"],Z=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(_);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=o.registerPane,i=o.unregisterPane;return n.useEffect(function(){return t.current&&a(t.current,Q),function(){t.current&&i(t.current,Q)}},[t,a,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},ee=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},ne=function(t){var r=t.columnIndexStart,a=t.columnIndices,i=t.headers,l=t.hoveredIndex,s=t.pinned,c=t.ref,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,p=t.visibleRows,m=t.width,g=s?"st-body-pinned-".concat(s):"st-body-main";return n.useMemo(function(){return B(i,s)},[i,s])?e.jsx(ee,o({condition:!s,wrapper:function(n){return e.jsx(Z,o({childRef:c},{children:n}))}},{children:e.jsx("div",o({className:g,ref:c,style:o({position:"relative",height:"".concat(v,"px"),width:m},!s&&{flexGrow:1})},{children:p.map(function(t,o){return e.jsxs(n.Fragment,{children:[0!==o&&e.jsx($,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:o-1}),e.jsx(J,{columnIndexStart:r,columnIndices:a,gridTemplateColumns:h,headers:i,hoveredIndex:l,index:o,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,visibleRow:t})]},t.position)})}))})):null};function te(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},a=0,i=function(e,n){void 0===n&&(n=!1),n||a++,o[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){i(e,0===n)})};return t.forEach(function(e,n){i(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;i(e,r)}),r.forEach(function(e){i(e,!1)}),o}var re=function(t){var r=t.headerContainerRef,a=t.mainTemplateColumns,i=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,c=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.pinnedRightWidth,f=t.setScrollTop,h=t.tableRows,p=t.visibleRows,m=x(),g=m.headers,w=m.mainBodyRef,b=m.rowHeight,C=m.rowIdAccessor,y=m.scrollbarWidth,I=m.tableBodyContainerRef,S=n.useState(null),j=S[0],E=S[1];!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,a=n.useState(!1),i=a[0],l=a[1];n.useEffect(function(){var e=null==t?void 0:t.current;if(i&&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,i,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;l(e)}};o();var a=new ResizeObserver(function(){o()});return a.observe(n),function(){n&&a.unobserve(n)}}},[t,r])}({headerContainerRef:r,mainSectionRef:I,scrollbarWidth:y});var R=n.useRef(null),k=function(e){return e.length}(h),N=k*(b+1)-1,F=n.useMemo(function(){return te({headers:g,pinnedLeftColumns:i,pinnedRightColumns:c})},[g,i,c]),D=n.useMemo(function(){var e={};return p.forEach(function(n,t){var r=String(v(n.row,t,C));e[r]=t}),e},[p,C]),M={columnIndices:F,headerContainerRef:r,headers:g,hoveredIndex:j,rowHeight:b,rowIndices:D,setHoveredIndex:E,visibleRows:p};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return E(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;R.current&&cancelAnimationFrame(R.current),R.current=requestAnimationFrame(function(){f(n)})},ref:I},{children:[e.jsx(ne,o({},M,{pinned:"left",templateColumns:l,totalHeight:N,width:s})),e.jsx(ne,o({},M,{columnIndexStart:i.length,ref:w,templateColumns:a,totalHeight:N})),e.jsx(ne,o({},M,{columnIndexStart:i.length+a.length,pinned:"right",templateColumns:u,totalHeight:N,width:d}))]}))},oe=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,oe(e.children)),n})},ae=function(e){return void 0===e&&(e=0),e?e+1:0},ie=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,a=e.headers,i=e.setHeaders,s=e.startWidth;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(o&&!o.hide){var v=h(o),p=t-r>1,m=p?d(o):[o],g=function(e){var n="right"===o.pinned?c-e:e-c;if(p&&m.length>1)le({delta:n,leafHeaders:m,minWidth:v,startWidth:s});else{var t=Math.max(s+n,v);o.width=t}a.forEach(function(e){f(e)});var r=l([],a,!0);i(r)};if(u){var w=function(e){var n=e.touches[0];g(n.clientX)},x=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",x)};document.addEventListener("touchmove",w),document.addEventListener("touchend",x)}else{var b=function(e){g(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},le=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,a=t.reduce(function(e,n){return Math.min(e,h(n))},40),i=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(o+n,a)-i;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/i),o=Math.max(n+t,r);e.width=o})},se=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+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(s({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:ae(t),rightWidth:ae(r),mainWidth:o}},ce=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},ue={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},de=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},fe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},he=function(e){return["between","notBetween","in","notIn"].includes(e)},ve=function(e){return["isEmpty","isNotEmpty"].includes(e)},pe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},me=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},ge=function(t){var r=t.value,a=t.onChange,i=t.options,l=t.placeholder,s=void 0===l?"Select...":l,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],m=n.useState(-1),g=m[0],w=m[1],x=n.useRef(null),b=i.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<i.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),g>=0&&(a(i[g].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,g,i,a]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=i.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:b?b.label:s})),e.jsx(me,{})]})),e.jsx(j,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===g?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),p(!1),void w(-1);var e}},{children:n.label}),n.value)})}))}))]}))},we=function(n){var t=n.value,r=n.onChange,a=n.operators.map(function(e){return{value:e,label:ue[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(ge,{value:t,onChange:function(e){r(e)},options:a})}))},xe=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,a=n.onChange,i=n.placeholder,l=n.autoFocus,s=void 0!==l&&l,c=n.className,u=void 0===c?"":c;return e.jsx("input",{type:r,value:o,onChange:function(e){return a(e.target.value)},placeholder:i,autoFocus:s,className:"st-filter-input ".concat(u).trim()})},be=function(n){var t=n.children,r=n.className,a=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(a).trim()},{children:t}))},Ce=function(n){var t=n.onApply,r=n.onClear,a=n.canApply,i=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!a,className:"st-filter-button st-filter-button-apply ".concat(a?"":"st-filter-button-disabled")},{children:"Apply"})),i&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},ye=function(t){var r=t.header,a=t.currentFilter,i=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"contains"),c=s[0],u=s[1],d=n.useState(String((null==a?void 0:a.value)||"")),f=d[0],h=d[1],v=de("string");n.useEffect(function(){a?(u(a.operator),h(String(a.value||""))):(u("contains"),h(""))},[a]);var p=ve(c)||f.trim();return e.jsxs(pe,{children:[e.jsx(we,{value:c,onChange:u,operators:v}),fe(c)&&e.jsx(be,{children:e.jsx(xe,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0})}),e.jsx(Ce,{onApply:function(){var e=o({accessor:r.accessor,operator:c},fe(c)&&{value:f});i(e)},onClear:l,canApply:!!p,showClear:!!a})]})},Ie=function(t){var r,o,a=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,c=n.useState((null==i?void 0:i.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==i?void 0:i.values)||void 0===r?void 0:r[0])||"")),m=p[0],g=p[1],w=n.useState(String((null===(o=null==i?void 0:i.values)||void 0===o?void 0:o[1])||"")),x=w[0],b=w[1],C=de("number");n.useEffect(function(){var e,n;i?(d(i.operator),v(String(i.value||"")),g(String((null===(e=i.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=i.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),g(""),b(""))},[i]);return e.jsxs(pe,{children:[e.jsx(we,{value:u,onChange:d,operators:C}),fe(u)&&e.jsx(be,{children:e.jsx(xe,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0})}),he(u)&&e.jsxs(be,{children:[e.jsx(xe,{type:"number",value:m,onChange:g,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(xe,{type:"number",value:x,onChange:b,placeholder:"To..."})]}),e.jsx(Ce,{onApply:function(){var e={accessor:a.accessor,operator:u};fe(u)?e.value=parseFloat(h):he(u)&&(e.values=[parseFloat(m.toString()),parseFloat(x.toString())]),l(e)},onClear:s,canApply:!!ve(u)||(fe(u)?""!==h.trim():!!he(u)&&""!==String(m).trim()&&""!==String(x).trim()),showClear:!!i})]})},Se=function(n){var t=n.value,r=n.onChange,o=n.options,a=n.className,i=void 0===a?"":a,l=n.placeholder;return e.jsx(ge,{value:t,onChange:r,options:o,className:i,placeholder:l})},je=function(t){var r=t.header,o=t.currentFilter,a=t.onApplyFilter,i=t.onClearFilter,l=n.useState((null==o?void 0:o.operator)||"equals"),s=l[0],c=l[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=de("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=ve(s)||""!==d;return e.jsxs(pe,{children:[e.jsx(we,{value:s,onChange:c,operators:h}),fe(s)&&e.jsx(be,{children:e.jsx(Se,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Ce,{onApply:function(){var e={accessor:r.accessor,operator:s};fe(s)&&(e.value="true"===d),a(e)},onClear:i,canApply:v,showClear:!!o})]})},Ee=function(t){var r,a,i=t.header,l=t.currentFilter,s=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==l?void 0:l.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==l?void 0:l.value)?String(l.value):""),v=h[0],p=h[1],m=n.useState((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])?String(l.values[0]):""),g=m[0],w=m[1],x=n.useState(String((null===(a=null==l?void 0:l.values)||void 0===a?void 0:a[1])||"")),b=x[0],C=x[1],y=de("date");n.useEffect(function(){var e,n;l?(f(l.operator),p(String(l.value||"")),w(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),C(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),C(""))},[l]);var I=function(t){var r=t.value,a=t.onChange,i=t.placeholder,l=t.autoFocus,s=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=new Date(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){l&&p.current&&p.current.focus()},[l]);var m=r?new Date(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:i,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(s||""),style:{cursor:"pointer"}}),e.jsx(j,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(F,{value:m,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(pe,{children:[e.jsx(we,{value:d,onChange:f,operators:y}),fe(d)&&e.jsx(be,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),he(d)&&e.jsxs(be,{children:[e.jsx(I,{value:g,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:b,onChange:C,placeholder:"To date..."})]}),e.jsx(Ce,{onApply:function(){var e={accessor:i.accessor,operator:d};fe(d)?e.value=v:he(d)&&(e.values=[g,b]),s(e)},onClear:c,canApply:!!ve(d)||(fe(d)?""!==v.trim():!!he(d)&&""!==g.trim()&&""!==b.trim()),showClear:!!l})]})},Re=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ke=function(n){var t=n.checked,r=void 0!==t&&t,a=n.children,i=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(Re,{className:"st-checkbox-checkmark"})})),a]}))},Ne=function(t){var r=t.header,a=t.currentFilter,i=t.onApplyFilter,s=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==a?void 0:a.values)?a.values.map(String):u),f=d[0],h=d[1];n.useEffect(function(){h(a?a.values?a.values.map(String):[]:u)},[a,u]);var v=f.length===u.length;return e.jsxs(pe,{children:[e.jsx(be,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(ke,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(ke,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):l(l([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e.jsx(Ce,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};i(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==u.length,showClear:!!a})]})},Fe=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,a=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Ie,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"boolean":return e.jsx(je,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"date":return e.jsx(Ee,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});case"enum":return e.jsx(Ne,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a});default:return e.jsx(ye,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:a})}}()})},De=n.forwardRef(function(t,r){var a,i,c=t.colIndex,u=t.gridColumnEnd,d=t.gridColumnStart,f=t.gridRowEnd,h=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,g=n.useState(!1),w=g[0],b=g[1],C=x(),y=C.columnReordering,I=C.columnResizing,S=C.draggedHeaderRef,E=C.filters,R=C.handleApplyFilter,k=C.handleClearFilter,N=C.headers,F=C.hoveredHeaderRef,D=C.onColumnOrderChange,M=C.onSort,H=C.onTableHeaderDragEnd,T=C.rowHeight,A=C.selectColumns,W=C.selectableColumns,B=C.setHeaders,O=C.setInitialFocusedCell,q=C.setSelectedCells,P=C.setSelectedColumns,z=C.sortDownIcon,U=C.sortUpIcon,G=Boolean(null==v?void 0:v.isSortable),K=Boolean(null==v?void 0:v.filterable),V=E[v.accessor],X="st-header-cell ".concat(v.accessor===(null===(a=F.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(i=S.current)||void 0===i?void 0:i.accessor)===v.accessor?"st-dragging":""," ").concat(G?"clickable":""," ").concat(y&&!G?"columnReordering":""," ").concat(v.children?"parent":""),J=Y({draggedHeaderRef:S,headers:N,hoveredHeaderRef:F,onColumnOrderChange:D,onTableHeaderDragEnd:H}),$=J.handleDragStart,_=J.handleDragEnd,Q=J.handleDragOver,Z=L(),ee=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,a=0,i=e.children;a<i.length;a++){var l=i[a];o=r(l,o)}return o};return r(e,n),t}(t,c);return n.shiftKey&&A?P(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 i,s,c,u,d=l(l([],(i=o,s=n,c=Math.min(i,s),u=Math.max(i,s),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(l(l([],Array.from(e),!0),d,!0))}):A&&A(r),q(new Set),void O(null)}t.isSortable&&M(c,t.accessor)};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var ne=I&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;Z({callback:ie,callbackProps:{event:e.nativeEvent,gridColumnEnd:u,gridColumnStart:d,header:v,headers:N,setHeaders:B,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})},onTouchStart:function(e){var n;Z({callback:ie,callbackProps:{event:e,gridColumnEnd:u,gridColumnStart:d,header:v,headers:N,setHeaders:B,startWidth:"object"==typeof r&&null!==r&&"current"in r?null===(n=r.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),te=m&&m.key.accessor===v.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return ee({event:e,header:v})}},{children:["ascending"===m.direction&&U&&U,"descending"===m.direction&&z&&z]})),re=K&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),b(!w)}},{children:[e.jsx(ce,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(j,o({open:w,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(Fe,{header:v,currentFilter:V,onApplyFilter:function(e){R(e),b(!1)},onClearFilter:function(){k(v.accessor),b(!1)}})}))]}));return e.jsxs("div",o({className:X,id:s({accessor:v.accessor,rowIndex:0}),onDragOver:function(e){Z({callback:Q,callbackProps:{event:e,hoveredHeader:v},limit:50})},ref:r,style:o(o({gridRowStart:h,gridRowEnd:f,gridColumnStart:d,gridColumnEnd:u},u-d>1?{}:{width:v.width}),f-h>1?{}:{height:T})},{children:[p&&ne,"right"===v.align&&re,"right"===v.align&&te,e.jsx("div",o({className:"st-header-label",draggable:y&&!v.disableReorder,onClick:function(e){return ee({event:e,header:v})},onDragEnd:function(e){e.preventDefault(),_()},onDragStart:function(e){y&&v&&function(e){$(e)}(v)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:c,header:v}):null==v?void 0:v.label}))})),"right"!==v.align&&te,"right"!==v.align&&re,!p&&ne]}))}),Me=function(t){var r=t.columnIndices,a=t.gridTemplateColumns,i=t.handleScroll,l=t.headers,s=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,a,i){var l,d;if(void 0===i&&(i=!1),!c({header:o,pinned:u}))return 0;i||n++;var f=null!==(d=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=a,m=f>0?a+1:s+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,a+1,g),g=!1)})}return v-h},o=l.filter(function(e){return c({header:e,pinned:u})}),a=!0;return o.forEach(function(e){t(e,1,a),a=!1}),e},[l,s,u,r]);return e.jsx(ee,o({condition:!u,wrapper:function(n){return e.jsx(Z,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},i&&{onScroll:i},{ref:d,style:{gridTemplateColumns:a,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(t){return e.jsx(De,{colIndex:t.colIndex,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)})})}))}))},He=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(He)):1},Te=function(t){var r=t.centerHeaderRef,a=t.headerContainerRef,i=t.headers,l=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,h=t.sort,v=t.pinnedLeftWidth,p=t.pinnedRightWidth,m=x(),g=m.pinnedLeftRef,w=m.pinnedRightRef,b=n.useMemo(function(){return te({headers:i,pinnedLeftColumns:s,pinnedRightColumns:d})},[i,s,d]),C=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=He(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:a},{children:[B(i,"left")&&e.jsx(Me,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:i,maxDepth:C,pinned:"left",sectionRef:g,sort:h,width:v}),e.jsx(Me,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:C,sectionRef:r,sort:h}),B(i,"right")&&e.jsx(Me,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headers:i,maxDepth:C,pinned:"right",sectionRef:w,sort:h,width:p})]}))},Ae=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.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(" "))},Le=function(t){var r=t.pinnedLeftWidth,a=t.pinnedRightWidth,i=t.setScrollTop,l=t.sort,s=t.tableRows,c=t.visibleRows,u=x(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=n.useRef(null),m=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),w=h.filter(function(e){return"right"===e.pinned}),b=n.useMemo(function(){return Ae({headers:g})},[g]),C=n.useMemo(function(){return Ae({headers:m})},[m]),y=n.useMemo(function(){return Ae({headers:w})},[w]),I={centerHeaderRef:p,headerContainerRef:v,headers:h,mainTemplateColumns:C,pinnedLeftColumns:g,pinnedLeftTemplateColumns:b,pinnedRightColumns:w,pinnedRightTemplateColumns:y,sort:l,pinnedLeftWidth:r,pinnedRightWidth:a},S={tableRows:s,headerContainerRef:v,mainTemplateColumns:C,pinnedLeftColumns:g,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:w,pinnedRightTemplateColumns:y,pinnedRightWidth:a,setScrollTop:i,visibleRows:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Te,o({},I)),e.jsx(re,o({},S))]}))},We=function(t){var r,a,i=t.mainBodyWidth,l=t.mainBodyRef,s=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=x().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),m=u.current&&u.current.scrollHeight>u.current.clientHeight,g=d?28:0,w=(d?c+1:c)+(u.current&&m?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(l.current){var e=l.current.clientWidth;v(i>e)}}()},1)},[l,i]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),i>0&&e.jsx(Z,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:i,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(a=p.current)||void 0===a?void 0:a.offsetHeight}}),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Be={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 a=r.getTime()-o.getTime();return"ascending"===t?a:-a},enum:function(e,n,t){return Be.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?Be.string(e,n,t):"number"==typeof e&&"number"==typeof n?Be.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Be.boolean(e,n,t):Be.string(String(e),String(n),t)}},Oe=function(e,n,t){var r=t.find(function(e){return e.accessor===n.key.accessor}),o=(null==r?void 0:r.type)||"string",a=n.direction;return l([],e,!0).sort(function(e,t){var r=n.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),a=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===a?o*=1e12:"B"===a?o*=1e9:"M"===a?o*=1e6:"K"===a&&(o*=1e3),o}}return parseFloat(t)||0},a=o(e),i=o(n);return Be.number(a,i,r)}return"date"===t?Be.date(String(e),String(n),r):"boolean"===t?Be.boolean(Boolean(e),Boolean(n),r):"enum"===t?Be.enum(String(e),String(n),r):Be.string(String(e),String(n),r)}(e[r],t[r],o,a)})},qe=function(e,n,t){return{sortedData:Oe(n,t,e),newSortConfig:t}},Pe=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var a=o[r];if(!t.has(a.accessor)&&(t.add(a.accessor),a.children&&a.children.length>0)){var i=a.children.some(function(e){return e.accessor===n}),l=!1;if(!i)for(var s=0,c=a.children;s<c.length;s++){var u=c[s];if(Pe([u],n,t),!1===u.hide){l=!0;break}}(i||l)&&(a.hide=!1)}}},ze=function(e){return e.every(function(e){return e.hide})},Ue=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Ue(e.children),ze(e.children)&&(e.hide=!0))})},Ye=function(t){var r=t.allHeaders,a=t.depth,i=void 0===a?0:a,s=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=x(),p=v.expandIcon,m=v.headers,g=v.setHeaders,w=s?"".concat(16*i,"px"):"8px",b=c.children&&c.children.length>0,C=null!=u?u:c.hide||b&&c.children&&ze(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[s&&e.jsx("div",o({className:"st-header-icon-container"},{children:b?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(ke,o({checked:C,onChange:function(e){(c.hide=e,e)?Ue(r):(Pe(r,c.accessor),b&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,Pe(r,c.children[0].accessor)));g(l([],m,!0))}},{children:c.label}))]})),b&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(Ye,{allHeaders:r,depth:i+1,doesAnyHeaderHaveChildren:s,header:n,isCheckedOverride:!!C||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Ge=function(t){var r=t.headers,a=t.open,i="left"===t.position?"left":"",l=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(a?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return e.jsx(Ye,{doesAnyHeaderHaveChildren:l,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},Ke=function(t){var r=t.columnEditorText,a=t.editColumns,i=t.editColumnsInitOpen,l=t.headers,s=t.position,c=void 0===s?"right":s,u=n.useState(i),d=u[0],f=u[1];return a?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(Ge,{headers:l,open:d,position:c})]})):null},Ve=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Xe=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},Je=function(t){var a=t.children,i=n.useRef({}),l=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),s=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),s(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});u(n,e)}))})})})}},[c,s]),d=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),l(e,n)||(i.current[n].length>0&&s(i.current[n][0],e),i.current[n].push(e))}),u(e,n)},[l,s,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(l(e,n)){c(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[l,c]);return e.jsx(_.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(a)}))},$e=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ue[e.operator],a="";return void 0!==e.value?a="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?a="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(a=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(a)},_e=function(){var n=x(),t=n.filters,r=n.handleClearFilter,a=n.headers,i=Object.values(t);return 0===i.length||i.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:i.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:$e(n,a)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},Qe=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Ze=function(e){var t=e.externalFilterHandling,r=e.rows,a=n.useState({}),i=a[0],l=a[1],s=n.useMemo(function(){return t||0===Object.keys(i).length?r:r.filter(function(e){return Object.values(i).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var a=String(e).toLowerCase(),i=r?String(r).toLowerCase():"";switch(t){case"equals":return a===i;case"notEquals":return a!==i;case"contains":return a.includes(i);case"notContains":return!a.includes(i);case"startsWith":return a.startsWith(i);case"endsWith":return a.endsWith(i)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),s=Number(r);switch(t){case"equals":return l===s;case"notEquals":return l!==s;case"greaterThan":return l>s;case"lessThan":return l<s;case"greaterThanOrEqual":return l>=s;case"lessThanOrEqual":return l<=s;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=Qe(h),m=Qe(v);switch(t){case"equals":return p.getTime()===m.getTime();case"notEquals":return p.getTime()!==m.getTime();case"before":return p<m;case"after":return p>m;case"between":if(o&&2===o.length){var g=o.map(function(e){return Qe(new Date(String(e||"")))}),w=g[0],x=g[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Qe(new Date(String(e||"")))});return w=b[0],x=b[1],p<w||p>x}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var y=String(e),I=o.includes(y);return"in"===t?I:!I}return!1}var S=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return S===j;case"notEquals":return S!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})})},[t,i,r]),c=n.useCallback(function(e){l(function(n){var t;return o(o({},n),((t={})[e.accessor]=e,t))})},[]),u=n.useCallback(function(e){l(function(n){var t=o({},n);return delete t[e],t})},[]),d=n.useCallback(function(){l({})},[]);return{filters:i,filteredRows:s,handleApplyFilter:c,handleClearFilter:u,handleClearAllFilters:d}},en=function(e){var t=e.rows,r=e.headers,a=e.rowGrouping;return n.useMemo(function(){if(!a||0===a.length)return t;var e=function(e){return oe(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=a[t],l=a[t+1],s=n[r];if(s&&Array.isArray(s)){var c=i(s,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=nn(c,e.accessor,e.aggregation,l);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return i(n)},[t,r,a])},nn=function(e,n,t,r){var o=[],a=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&Array.isArray(t)?a(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(a(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var i,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.filter(function(e){return"number"==typeof e&&!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":i=l.reduce(function(e,n){return e+n},0);break;case"average":i=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":i=o.length;break;case"min":i=Math.min.apply(Math,l);break;case"max":i=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(i):i}},tn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,s=t.cellUpdateFlash,c=void 0!==s&&s,f=t.columnEditorPosition,h=void 0===f?"right":f,g=t.columnEditorText,x=void 0===g?"Columns":g,I=t.columnReordering,S=void 0!==I&&I,j=t.columnResizing,E=void 0!==j&&j,R=t.defaultHeaders,k=t.editColumns,N=void 0!==k&&k,F=t.editColumnsInitOpen,D=void 0!==F&&F,M=t.expandAll,H=void 0===M||M,T=t.expandIcon,A=void 0===T?e.jsx(y,{className:"st-expand-icon"}):T,L=t.externalFilterHandling,W=void 0!==L&&L,B=t.externalSortHandling,O=void 0!==B&&B,q=t.height,P=t.hideFooter,z=void 0!==P&&P,U=t.nextIcon,Y=void 0===U?e.jsx(y,{className:"st-next-prev-icon"}):U,G=t.onCellEdit,K=t.onColumnOrderChange,V=t.onFilterChange,X=t.onGridReady,J=t.onNextPage,$=t.onSortChange,_=t.prevIcon,Q=void 0===_?e.jsx(C,{className:"st-next-prev-icon"}):_,Z=t.rowGrouping,ee=t.rowHeight,ne=void 0===ee?32:ee,te=t.rowIdAccessor,re=t.rows,oe=t.rowsPerPage,ae=void 0===oe?10:oe,ie=t.selectableCells,le=void 0!==ie&&ie,ce=t.selectableColumns,ue=void 0!==ce&&ce,de=t.shouldPaginate,fe=void 0!==de&&de,he=t.sortDownIcon,ve=void 0===he?e.jsx(Ve,{className:"st-header-icon"}):he,pe=t.sortUpIcon,me=void 0===pe?e.jsx(Xe,{className:"st-header-icon"}):pe,ge=t.tableRef,we=t.theme,xe=void 0===we?"light":we,be=t.useHoverRowBackground,Ce=void 0===be||be,ye=t.useOddEvenRowBackground,Ie=void 0===ye||ye,Se=t.useOddColumnBackground,je=void 0!==Se&&Se;je&&(Ie=!1);var Ee=n.useReducer(function(e){return e+1},0)[1],Re=n.useRef(null),ke=n.useRef(null),Ne=n.useRef(null),Fe=n.useRef(null),De=n.useRef(null),Me=n.useRef(null),He=n.useState(1),Te=He[0],Ae=He[1],Be=n.useState(R),Oe=Be[0],Pe=Be[1];n.useEffect(function(){Pe(R)},[R]);var ze=n.useState(0),Ue=ze[0],Ye=ze[1],Ge=n.useState(0),$e=Ge[0],Qe=Ge[1],nn=n.useState(new Set),tn=nn[0],rn=nn[1],on=Ze({externalFilterHandling:W,rows:re}),an=on.filters,ln=on.filteredRows,sn=on.handleApplyFilter,cn=on.handleClearFilter,un=on.handleClearAllFilters,dn=n.useCallback(function(e){sn(e)},[sn]),fn=function(e){var t=e.headers,r=e.tableRows,a=e.externalSortHandling,i=e.onSortChange,l=e.rowGrouping,s=n.useState(null),c=s[0],u=s[1],d=function(e,n,t,r){var a=qe(t,e,n).sortedData;return r&&0!==r.length?a.map(function(e){var a,i=r[0],l=e[i];if(Array.isArray(l)&&l.length>0){var s=d(l,n,t,r.slice(1));return o(o({},e),((a={})[i]=s,a))}return e}):a},f=n.useMemo(function(){return a?r:c?l&&l.length>0?d(r,c,t,l):qe(t,r,c).sortedData:r},[r,c,t,a,l]);return{setSort:u,sort:c,sortedRows:f,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var a=o[t];if(a.accessor===n)return a;if(a.children&&a.children.length>0){var i=r(a.children);if(i)return i}}},o=r(t);if(o){var a=null;c&&c.key.accessor===n?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},u(a),null==i||i(a)}}}}({headers:Oe,tableRows:ln,externalSortHandling:O,onSortChange:$,rowGrouping:Z}),hn=fn.sort,vn=fn.sortedRows,pn=fn.updateSort;n.useEffect(function(){null==V||V(an)},[an,V]),n.useEffect(function(){null==$||$(hn)},[hn,$]);var mn=n.useMemo(function(){var e=se({headers:Oe});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Oe]),gn=mn.mainBodyWidth,wn=mn.pinnedLeftWidth,xn=mn.pinnedRightWidth;n.useEffect(function(){null==X||X()},[X]);var bn=n.useMemo(function(){if(!fe)return vn;var e=(Te-1)*ae,n=e+ae;return vn.slice(e,n)},[Te,ae,fe,vn]),Cn=en({rows:bn,headers:Oe,rowGrouping:Z}),yn=n.useMemo(function(){return Z&&0!==Z.length?p({rows:Cn,rowGrouping:Z,rowIdAccessor:te,unexpandedRows:tn,expandAll:H}):Cn.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[Cn,Z,te,tn,H]),In=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var a=parseInt(t,10);o=window.innerHeight*a/100}else if(t.endsWith("%")){var i=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*i/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:q,rowHeight:ne}),Sn=n.useMemo(function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.tableRows,o=e.rowHeight,a=e.scrollTop,i=o+1,l=Math.max(0,a-i*n),s=a+t+i*n,c=Math.max(0,Math.floor(l/i)),u=Math.min(r.length,Math.ceil(s/i));return r.slice(c,u)}({bufferRowCount:5,contentHeight:In,tableRows:yn,rowHeight:ne,scrollTop:Ue})},[In,ne,yn,Ue]),jn=n.useRef(new Map),En=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,l=e.rowIdAccessor,s=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],p=n.useState(new Set),g=p[0],w=p[1],x=n.useState(null),b=x[0],C=x[1],y=n.useState(null),I=y[0],S=y[1],j=n.useState(new Set),E=j[0],R=j[1],k=n.useState(new Set),N=k[0],F=k[1],D=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){return r.flatMap(d)},[r]),T=n.useCallback(function(){var e=H.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,a=t.split("-").map(Number),i=a[0],l=a[1];e[i]||(e[i]=[]);var s=n.get(l);return s&&(null===(r=o[i])||void 0===r?void 0:r.row)?e[i][l]=o[i].row[s]:e[i][l]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),R(new Set(f)),setTimeout(function(){R(new Set)},800))},[H,f,o]),A=n.useCallback(function(){return a(void 0,void 0,void 0,function(){var e,n,t,r,a,u,d,f;return i(this,function(i){switch(i.label){case 0:if(!I)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=i.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=H.filter(function(e){return!e.hide}),r=new Set,a=new Set,u=I.rowIndex,d=I.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,i){var f=u+n,h=d+i;if(!(f>=o.length||h>=t.length)){var p=o[f],g=t[h],w=v(p.row,f,l);if(null==g?void 0:g.isEditable){var x=e;if("number"===g.type){var b=Number(e);isNaN(b)||(x=b)}else if("boolean"===g.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===g.type){var C=new Date(e);isNaN(C.getTime())||(x=C)}if(p.row[g.accessor]=x,c){var y="".concat(w,"-").concat(g.accessor),I=c.get(y);I&&I.updateContent(x)}null==s||s({accessor:g.accessor,newValue:x,row:p.row,rowIndex:f});var S=m({colIndex:h,rowIndex:f,rowId:w});r.add(S)}else{var j=m({colIndex:h,rowIndex:f,rowId:w});a.add(j)}}})}),r.size>0&&(R(r),setTimeout(function(){R(new Set)},800)),a.size>0&&(F(a),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=i.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[I,H,o,l,s,c]),L=n.useCallback(function(){if(0!==f.size){var e=H.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var a=n.split("-").map(Number),i=a[0],u=a[1];if(!(i>=o.length||u>=e.length)){var d=o[i],f=e[u],h=v(d.row,i,l);if(null==f?void 0:f.isEditable){var p=null;if(p="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:""),d.row[f.accessor]=p,c){var m="".concat(h,"-").concat(f.accessor),g=c.get(m);g&&g.updateContent(p)}null==s||s({accessor:f.accessor,newValue:p,row:d.row,rowIndex:i}),t.add(n)}else r.add(n)}}),t.size>0&&(R(t),setTimeout(function(){R(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,H,o,l,s,c]),W=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),a=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),c=r;c<=a;c++)for(var u=i;u<=s;u++)if(c>=0&&c<o.length){var d=v(o[c].row,c,l);t.add(m({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),C(null),h(t)},[o,l,w,C,h]),B=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<H.length){var n=m(e);w(new Set),C(null),h(new Set([n])),S(e)}},[H.length,o.length,w,C,h,S]),O=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),S(null),w(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&C(e[e.length-1])},[h,S,w,C]);n.useEffect(function(){var e=function(e){var n;if(t&&I){var r=I.rowIndex,a=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void A();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void L();if(v(null===(n=o[r])||void 0===n?void 0:n.row,r,l)!==i){var s=o.findIndex(function(e,n){return v(e.row,n,l)===i});if(-1===s)return;r=s}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=v(o[r-1].row,r-1,l);B({rowIndex:r-1,colIndex:a,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=v(o[r+1].row,r+1,l),B({rowIndex:r+1,colIndex:a,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),a>0&&(c=v(o[r].row,r,l),B({rowIndex:r,colIndex:a-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),a<H.length-1&&(c=v(o[r].row,r,l),B({rowIndex:r,colIndex:a+1,rowId:c}))):"Escape"===e.key&&(h(new Set),w(new Set),C(null),M.current=null,S(null))}else T()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[T,H.length,I,l,W,B,t,o,A,L]);var q=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),a=f.has(o),i=g.has(n);return a||i},[f,g]),P=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,a=[],i=o[t-1]?v(o[t-1].row,t-1,l):null,s=o[t+1]?v(o[t+1].row,t+1,l):null,c=null!==i?{colIndex:n,rowIndex:t-1,rowId:i}:null,u=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!q(c)||g.has(n)&&0===t)&&a.push("st-selected-top-border"),(!u||!q(u)||g.has(n)&&t===o.length-1)&&a.push("st-selected-bottom-border"),q(d)||a.push("st-selected-left-border"),q(f)||a.push("st-selected-right-border"),a.join(" ")},[q,o,g,l]),z=n.useMemo(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]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return E.has(o)},[E]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:P,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(D.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){w(new Set),C(null);var e=m({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),S({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&D.current&&M.current){for(var a=new Set,i=Math.min(M.current.rowIndex,r),s=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=i;d<=s;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var p=v(o[d].row,d,l);a.add(m({colIndex:f,rowIndex:d,rowId:p}))}h(a)}},handleMouseUp:function(){D.current=!1},isCopyFlashing:U,isWarningFlashing:Y,isInitialFocusedCell:z,isSelected:q,lastSelectedColumnIndex:b,pasteFromClipboard:A,selectColumns:O,selectedCells:f,selectedColumns:g,setInitialFocusedCell:S,setSelectedCells:h,setSelectedColumns:w,deleteSelectedCells:L}}({selectableCells:le,headers:Oe,tableRows:yn,rowIdAccessor:te,onCellEdit:G,cellRegistry:jn.current}),Rn=En.getBorderClass,kn=En.handleMouseDown,Nn=En.handleMouseOver,Fn=En.handleMouseUp,Dn=En.isCopyFlashing,Mn=En.isInitialFocusedCell,Hn=En.isSelected,Tn=En.isWarningFlashing,An=En.selectColumns,Ln=En.selectedCells,Wn=En.selectedColumns,Bn=En.setInitialFocusedCell,On=En.setSelectedCells,qn=En.setSelectedColumns,Pn=n.useCallback(function(e,n){pn(e,n)},[pn]),zn=n.useCallback(function(e){Pe(e)},[]);return function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,a=e.setSelectedCells,i=e.setSelectedColumns;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(r.size>0&&a(new Set),o.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,a,i])}({selectableColumns:ue,selectedCells:Ln,selectedColumns:Wn,setSelectedCells:On,setSelectedColumns:qn}),n.useLayoutEffect(function(){if(Me.current){var e=Me.current.offsetWidth-Me.current.clientWidth;Qe(e)}},[]),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:Ee,tableBodyContainerRef:Me,setScrollbarWidth:Qe}),n.useEffect(function(){ge&&(ge.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,r=e.newValue,o=null==re?void 0:re[t];if(o){var a=v(o,t,te),i=u({rowId:a,accessor:n}),l=jn.current.get(i);l&&l.updateContent(r),void 0!==o[n]&&(o[n]=r)}}})},[ge,re,te]),e.jsx(w,o({value:{allowAnimations:l,cellRegistry:jn.current,cellUpdateFlash:c,columnReordering:S,columnResizing:E,draggedHeaderRef:Re,editColumns:N,expandIcon:A,unexpandedRows:tn,filters:an,tableRows:yn,forceUpdate:Ee,getBorderClass:Rn,handleApplyFilter:dn,handleClearFilter:cn,handleClearAllFilters:un,handleMouseDown:kn,handleMouseOver:Nn,headers:Oe,hoveredHeaderRef:ke,isCopyFlashing:Dn,isInitialFocusedCell:Mn,isSelected:Hn,isWarningFlashing:Tn,mainBodyRef:Ne,nextIcon:Y,onCellEdit:G,onColumnOrderChange:K,onSort:Pn,onTableHeaderDragEnd:zn,pinnedLeftRef:Fe,pinnedRightRef:De,prevIcon:Q,rowGrouping:Z,rowHeight:ne,rowIdAccessor:te,scrollbarWidth:$e,selectColumns:An,selectableColumns:ue,setUnexpandedRows:rn,setHeaders:Pe,setInitialFocusedCell:Bn,setSelectedCells:On,setSelectedColumns:qn,shouldPaginate:fe,sortDownIcon:ve,sortUpIcon:me,tableBodyContainerRef:Me,theme:xe,useHoverRowBackground:Ce,useOddColumnBackground:je,useOddEvenRowBackground:Ie}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(xe),style:q?{height:q}:{}},{children:e.jsx(Je,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(_e,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Fn,onMouseLeave:Fn},{children:[e.jsx(Le,{tableRows:yn,pinnedLeftWidth:wn,pinnedRightWidth:xn,setScrollTop:Ye,sort:hn,visibleRows:Sn}),e.jsx(Ke,{columnEditorText:x,editColumns:N,editColumnsInitOpen:D,headers:Oe,position:h})]})),e.jsx(We,{mainBodyRef:Ne,mainBodyWidth:gn,pinnedLeftWidth:wn,pinnedRightWidth:xn,tableBodyContainerRef:Me}),e.jsx(b,{currentPage:Te,hideFooter:z,onPageChange:Ae,onNextPage:J,shouldPaginate:fe,totalPages:Math.ceil(vn.length/ae)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),a=r[0],i=r[1];return n.useEffect(function(){i(!0)},[]),a?e.jsx(tn,o({},t)):null};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.5",
2
+ "version": "1.1.6",
3
3
  "main": "dist/index.js",
4
4
  "module": "dist/index.es.js",
5
5
  "types": "dist/index.d.ts",