simple-table-core 0.8.34 → 0.8.36

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.
@@ -1,8 +1,7 @@
1
- import React from "react";
2
1
  interface DatePickerProps {
3
- value: Date;
4
2
  onChange: (date: Date) => void;
5
3
  onClose?: () => void;
4
+ value: Date;
6
5
  }
7
- declare const DatePicker: React.FC<DatePickerProps>;
6
+ declare const DatePicker: ({ onChange, onClose, value }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export default DatePicker;
@@ -7,6 +7,7 @@ export interface DropdownProps {
7
7
  overflow?: "auto" | "visible";
8
8
  setOpen: (open: boolean) => void;
9
9
  width?: number;
10
+ positioning?: "fixed" | "absolute";
10
11
  }
11
12
  declare const Dropdown: React.FC<DropdownProps>;
12
13
  export default Dropdown;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  export interface CustomSelectOption {
3
2
  value: string;
4
3
  label: string;
@@ -11,5 +10,5 @@ interface CustomSelectProps {
11
10
  className?: string;
12
11
  disabled?: boolean;
13
12
  }
14
- declare const CustomSelect: React.FC<CustomSelectProps>;
13
+ declare const CustomSelect: ({ value, onChange, options, placeholder, className, disabled, }: CustomSelectProps) => import("react/jsx-runtime").JSX.Element;
15
14
  export default CustomSelect;
@@ -4,7 +4,6 @@ interface FilterSelectProps {
4
4
  value: string;
5
5
  onChange: (value: string) => void;
6
6
  options: CustomSelectOption[];
7
- autoFocus?: boolean;
8
7
  className?: string;
9
8
  placeholder?: string;
10
9
  }
@@ -1,10 +1,10 @@
1
- import React from "react";
1
+ import CellValue from "../../../types/CellValue";
2
2
  interface DateDropdownEditProps {
3
3
  onBlur: () => void;
4
4
  onChange: (value: string) => void;
5
5
  open: boolean;
6
6
  setOpen: (open: boolean) => void;
7
- value: string;
7
+ value: CellValue;
8
8
  }
9
- declare const DateDropdownEdit: React.FC<DateDropdownEditProps>;
9
+ declare const DateDropdownEdit: ({ onBlur, onChange, open, setOpen, value }: DateDropdownEditProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export default DateDropdownEdit;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import EnumOption from "../../../types/EnumOption";
3
2
  interface EnumDropdownEditProps {
4
3
  onBlur: () => void;
@@ -8,5 +7,5 @@ interface EnumDropdownEditProps {
8
7
  setOpen: (open: boolean) => void;
9
8
  value: string;
10
9
  }
11
- declare const EnumDropdownEdit: React.FC<EnumDropdownEditProps>;
10
+ declare const EnumDropdownEdit: ({ onBlur, onChange, open, options, setOpen, value, }: EnumDropdownEditProps) => import("react/jsx-runtime").JSX.Element;
12
11
  export default EnumDropdownEdit;
@@ -0,0 +1,6 @@
1
+ interface UseContentHeightProps {
2
+ height?: string;
3
+ rowHeight: number;
4
+ }
5
+ export declare const useContentHeight: ({ height, rowHeight }: UseContentHeightProps) => number;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ declare const useHandleOutsideClick: ({ selectableColumns, selectedCells, selectedColumns, setSelectedCells, setSelectedColumns, }: {
2
+ selectableColumns: boolean;
3
+ selectedCells: Set<string>;
4
+ selectedColumns: Set<number>;
5
+ setSelectedCells: (cells: Set<string>) => void;
6
+ setSelectedColumns: (columns: Set<number>) => void;
7
+ }) => void;
8
+ export default useHandleOutsideClick;
@@ -0,0 +1,14 @@
1
+ import { TableFilterState, FilterCondition } from "../types/FilterTypes";
2
+ import Row from "../types/Row";
3
+ interface UseTableFiltersProps {
4
+ rows: Row[];
5
+ }
6
+ interface UseTableFiltersReturn {
7
+ filters: TableFilterState;
8
+ filteredRows: Row[];
9
+ handleApplyFilter: (filter: FilterCondition) => void;
10
+ handleClearFilter: (accessor: string) => void;
11
+ handleClearAllFilters: () => void;
12
+ }
13
+ export declare const useTableFilters: ({ rows }: UseTableFiltersProps) => UseTableFiltersReturn;
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import { RefObject } from "react";
2
+ declare const useWindowResize: ({ forceUpdate, tableBodyContainerRef, setScrollbarWidth, }: {
3
+ forceUpdate: () => void;
4
+ tableBodyContainerRef: RefObject<HTMLDivElement | null>;
5
+ setScrollbarWidth: (width: number) => void;
6
+ }) => void;
7
+ export default useWindowResize;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import type CellChangeProps from "./types/CellChangeProps";
5
5
  import type CellValue from "./types/CellValue";
6
6
  import type ColumnEditorPosition from "./types/ColumnEditorPosition";
7
7
  import type DragHandlerProps from "./types/DragHandlerProps";
8
+ import EnumOption from "./types/EnumOption";
8
9
  import type HeaderObject from "./types/HeaderObject";
9
10
  import type OnSortProps from "./types/OnSortProps";
10
11
  import type Row from "./types/Row";
@@ -17,4 +18,4 @@ import type TableRowProps from "./types/TableRowProps";
17
18
  import type Theme from "./types/Theme";
18
19
  import type UpdateDataProps from "./types/UpdateCellProps";
19
20
  export { SimpleTable };
20
- export type { BoundingBox, Cell, CellChangeProps, CellValue, ColumnEditorPosition, DragHandlerProps, HeaderObject, OnSortProps, Row, SharedTableProps, SortConfig, TableCellProps, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, };
21
+ export type { BoundingBox, Cell, CellChangeProps, CellValue, ColumnEditorPosition, DragHandlerProps, EnumOption, HeaderObject, OnSortProps, Row, SharedTableProps, SortConfig, TableCellProps, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, };
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,useCallback as a,useEffect as l,useMemo as c,createContext as d,useContext as s,forwardRef as u,useLayoutEffect as h,Fragment as f,cloneElement as v,useReducer as p,createRef 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 C(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 y(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 b=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},I=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},x=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},R=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return R(e)})):[e]},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(b({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},N=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(b({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){N(e)}))},k=function(e){return"number"==typeof e.minWidth?e.minWidth:40},S=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},M=d(void 0),W=function(n){var t=n.children,r=n.value;return e(M.Provider,g({value:r},{children:t}))},D=function(){var e=s(M);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},F=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,d=t.totalPages,s=D(),u=s.nextIcon,h=s.prevIcon,f=o(!0),v=f[0],p=f[1],m=!(r>1),y=!(r<d)&&!l||!v&&r===d;if(i||!c)return null;var b=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 i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<d-1&&(t.push(-1),t.push(d)),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(y?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return C(this,(function(t){switch(t.label){case 0:return e=r===d,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<=d||l)&&a(n),[2]}}))}))},disabled:y},{children:u})),b.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<=d&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},L=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"})}))},H=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"})}))},B=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:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},T=function(e){return e.position*(e.rowHeight+1)-1},O=function(e){return e.position*(e.rowHeight+1)},P=function(n){var t=n.children,r=n.onClose,a=n.open,c=n.overflow,d=void 0===c?"auto":c,s=n.setOpen,u=n.width,h=n.containerRef,f=D().mainBodyRef,v=i(null),p=i(null),m=o("bottom-left"),w=m[0],C=m[1],y=o({}),b=y[0],I=y[1],x=o(!1),R=x[0],E=x[1];return l((function(){a&&v.current?(E(!1),!p.current&&v.current.parentElement&&(p.current=v.current.parentElement),requestAnimationFrame((function(){if(v.current&&p.current){var e,n=v.current,t=p.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==f?void 0:f.current)?f.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 d="left";o>e.right-t.right+t.width&&(d="right"),"bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===d?c.left=t.left:c.right=window.innerWidth-t.right,C("".concat(l,"-").concat(d)),I(c),E(!0)}}))):a||E(!1)}),[a,u,h,f]),l((function(){var e=function(e){if(a&&v.current){var n=e.target;v.current&&!v.current.contains(n)&&(s(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,r,s]),l((function(){var e=function(e){v.current&&!v.current.contains(e.target)&&(s(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[r,a,s]),l((function(){var e=function(e){"Escape"===e.key&&a&&(s(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,a,s]),a?e("div",g({ref:v,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:g(g({width:u?"".concat(u,"px"):"auto",visibility:R?"visible":"hidden"},b),{overflow:d})},{children:t})):null},A=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,d=void 0===c?"":c;return e("div",g({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(d),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},q=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,d=o(c),s=d[0],u=d[1],h=function(e){u(e),i(e),l(!1),r()};return n(P,g({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(A,g({isSelected:!0===s,onClick:function(){return h(!0)}},{children:"True"})),e(A,g({isSelected:!1===s,onClick:function(){return h(!1)}},{children:"False"}))]}))},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,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)}})},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,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)}})},U=function(r){var i,a,l=r.value,c=r.onChange,d=r.onClose,s=D(),u=s.nextIcon,h=s.prevIcon,f=o(l||new Date),v=f[0],p=f[1],m=o("days"),w=m[0],C=m[1],y=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 C("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:u}))]}),"months"===w&&e("div",g({className:"st-datepicker-header-label",onClick:function(){return C("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=y(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=y(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 s=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),c(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(l).getDate()&&r===new Date(l).getMonth()&&t===new Date(l).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),c(n),null==d||d()}(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),c(n),null==d||d()}(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)),C("days")}(t)}},{children:n}),"month-".concat(t)))})),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",g({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),C("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",g({className:"st-datepicker-footer"},{children:e("button",g({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),c(e),null==d||d()}},{children:"Today"}))}))]}))},Y=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.setOpen,c=n.value,d=o(function(e){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setUTCFullYear(t),i.setUTCMonth(r-1),i.setUTCDate(o),isNaN(i.getTime())?new Date:i}(c)),s=d[0],u=d[1];l((function(){var e=setTimeout((function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()}),0);return function(){return clearTimeout(e)}}),[]);var h=function(){t()};return e(P,g({open:i,onClose:h,setOpen:a,width:280},{children:e(U,{value:s,onChange:function(e){u(e),r(e.toISOString()),a(!1),t()},onClose:h})}))},J=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,d=o(c||""),s=d[0],u=d[1];return e(P,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(A,g({isSelected:s===n.value,onClick:function(){return e=n.value,u(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,d=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(q,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(Y,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:"string"==typeof c?c:""});if("enum"===l)return e(J,{onBlur:d,onChange:function(e){return o(e)},open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(z,{defaultValue:c,onBlur:d,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==c?"":String(c);return e(j,{defaultValue:s,onBlur:d,onChange:function(e){return o(e)}})},X=0,G=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))}},K=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(K);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=K(e[t]));return n},$=Date.now(),_={screenX:0,screenY:0},Q=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 y(y([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Q(o.children,n,y(y([],t,!0),[r],!1));if(i)return i}}return null};var Z=function(e){var n,t,r=e.draggedHeaderRef,o=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(n=o.current,t=i(n),l((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,$=Date.now()},handleDragOver:function(e){var n,t,i=e.event,l=e.hoveredHeader;if(i.preventDefault(),o.current){var c=i.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=i.screenX,h=i.screenY,f=Math.sqrt(Math.pow(u-_.screenX,2)+Math.pow(h-_.screenY,2));a.current=l;var v=o.current,p=Q(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),m=Q(v,l.accessor);if(p&&m){var g=p.length,w=m.length,C=m;if(g!==w){var y=w-g;y>0&&(C=m.slice(0,-y))}var b=function(e,n,t){var r=K(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}}(v,p,C),I=b.newHeaders,x=b.emergencyBreak;if(!(c||l.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===p.length||0===C.length||JSON.stringify(I)===JSON.stringify(o.current)||x)){var R=Date.now();JSON.stringify(I)===JSON.stringify(s)&&(R-$<1500||f<40)||($=R,_={screenX:u,screenY:h},d(I))}}}},handleDragEnd:function(){r.current=null,a.current=null,null==c||c(o.current)}}},ee=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},ne=u((function(t,r){var c,d,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,p=t.nestedIndex,m=t.onExpandRowClick,w=t.rowIndex,C=t.visibleRow,y=D(),I=y.cellRegistry,R=y.cellUpdateFlash,E=y.collapseIcon,N=y.draggedHeaderRef,k=y.expandIcon,S=y.handleMouseDown,M=y.handleMouseOver,W=y.headersRef,F=y.hoveredHeaderRef,L=y.onCellEdit,H=y.onTableHeaderDragEnd,B=y.theme,T=y.useOddColumnBackground,O=C.depth,P=C.row,A=o(P.rowData[h.accessor]),q=A[0],j=A[1],z=o(!1),U=z[0],Y=z[1],J=o(!1),X=J[0],K=J[1],$=i(null),_=Z({draggedHeaderRef:N,headersRef:W,hoveredHeaderRef:F,onTableHeaderDragEnd:H}).handleDragOver,Q=G(),ne="cell-".concat(w,"-").concat(u),te=x({rowId:P.rowMeta.rowId,accessor:h.accessor});l((function(){if(I){var e="".concat(P.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){q!==e?(j(e),R&&(K(!0),$.current&&clearTimeout($.current),$.current=setTimeout((function(){K(!1)}),800))):j(e)}}),function(){I.delete(e),$.current&&clearTimeout($.current)}}}),[I,R,P.rowMeta.rowId,h.accessor,q]),l((function(){if(X){var e=setTimeout((function(){K(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),l((function(){j(P.rowData[h.accessor])}),[P.rowData,h.accessor]),l((function(){f||Y(!1)}),[f]);var re="boolean"===h.type||"date"===h.type||"enum"===h.type,oe=Boolean(null===(d=null===(c=P.rowMeta)||void 0===c?void 0:c.children)||void 0===d?void 0:d.length),ie=Boolean(null==h?void 0:h.isEditable),ae="st-cell ".concat(O>0&&h.expandable?"st-cell-depth-".concat(O):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ie?"clickable":""," ").concat(X?"st-cell-updating":""," ").concat(T?p%2==0?"even-column":"odd-column":""),le=a((function(e){j(e),null==L||L({accessor:h.accessor,newValue:e,row:P})}),[h.accessor,L,P]);return U&&!re?e("div",g({className:"st-cell-editing",id:b({accessor:h.accessor,rowIndex:w+1})},{children:e(V,{enumOptions:h.enumOptions,onChange:le,setIsEditing:Y,type:h.type,value:q})})):n("div",g({className:ae,id:ne,onDoubleClick:function(){return h.isEditable&&Y(!0)},onMouseDown:function(){return S({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onMouseOver:function(){return M({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onDragOver:function(e){return Q({callback:_,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||U||(e.preventDefault(),Y(!0))},ref:r,"data-row-index":w,"data-col-index":u,"data-row-id":P.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&oe?P.rowMeta.isExpanded?e("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)}},{children:E})):e("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)}},{children:k})):null,e("span",g({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:e("span",{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:P,theme:B}):ee({content:q,header:h})})})),U&&re&&e(V,{enumOptions:h.enumOptions,onChange:le,setIsEditing:Y,type:h.type,value:q})]}),te)})),te=function(n){var r=n.children,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return D().allowAnimations?e(re,g({},o,{children:r})):e(t,{children:r})},re=function(n){var r=n.children,a=n.isBody,c=n.pauseAnimation,d=n.rowIndex,s=i(!1),u=D(),f=u.draggedHeaderRef,v=u.headersRef,p=u.mainBodyRef,m=u.shouldPaginate,g=o({}),w=g[0],C=g[1],y=i({}),I=v.current;return h((function(){if(I){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(b({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),l=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=l}}})),o}({currentHeaders:I,draggedHeaderRef:f,rowIndex:d});JSON.stringify(e)!==JSON.stringify(w)&&(y.current=w,C(e))}}),[w,I,f,a,d]),h((function(){var e=p.current,n=function(){s.current=!0},t=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[f,p]),l((function(){c||s.current||Object.keys(y.current).length&&I&&I.forEach((function(e){var n=document.getElementById(b({accessor:e.accessor,rowIndex:d}));if(n){var t=y.current[e.accessor],r=w[e.accessor];if(t&&r){var o=t.left-r.left,i=m?0:t.top-r.top,a=Math.abs(o),l=Math.abs(i);(a>10||l>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[w,I,a,c,y,d,m]),e(t,{children:r})},oe=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,l=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return I({hiddenColumns:i,header:e,pinned:c})}));return e(te,g({isBody:!0,pauseAnimation:a,rowIndex:d+1},{children:h.map((function(n,a){return e(ie,{columnIndices:r,header:n,headers:o,hiddenColumns:i,nestedIndex:a+(null!=t?t:0),onExpandRowClick:l,pinned:c,rowIndex:d,rowIndices:s,visibleRow:u},b({accessor:n.accessor,rowIndex:d+1}))}))}))},ie=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.nestedIndex,l=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=t[r.accessor],v=D(),p=v.getBorderClass,m=v.isSelected,g=v.isInitialFocusedCell;if(r.children){var w=r.children.filter((function(e){return I({hiddenColumns:i,header:e,pinned:c})}));return e(f,{children:w.map((function(n){return e(ie,{columnIndices:t,header:n,headers:o,hiddenColumns:i,nestedIndex:a,onExpandRowClick:l,pinned:c,rowIndex:d,rowIndices:s,visibleRow:u},b({accessor:n.accessor,rowIndex:d+1}))}))})}var C={rowIndex:d,colIndex:h,rowId:u.row.rowMeta.rowId},y=p(C),x=m(C),R=g(C);return e(ne,{borderClass:y,colIndex:h,header:r,isHighlighted:x,isInitialFocused:R,nestedIndex:a,onExpandRowClick:l,rowIndex:d,visibleRow:u},b({accessor:r.accessor,rowIndex:d+1}))},ae=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.hoveredIndex,c=n.index,d=n.isWidthDragging,s=n.onExpandRowClick,u=n.pinned,h=n.rowHeight,f=n.rowIndices,v=n.setHoveredIndex,p=n.visibleRow,m=D().useHoverRowBackground,w=p.position;return e("div",g({className:"st-row ".concat(w%2==0?"even":"odd"," ").concat(l===c&&m?"hovered":""),onMouseEnter:function(){v(c)},style:{gridTemplateColumns:o,top:O({position:w,rowHeight:h}),height:"".concat(h,"px")}},{children:e(oe,{columnIndexStart:r,columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:d,onExpandRowClick:s,pinned:u,rowIndex:c,rowIndices:f,visibleRow:p},c)}))},le=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",g({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:T({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},ce=d(void 0),de=["default"],se=function(e){var n=e.childRef,t=e.children,r=function(){var e=s(ce);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return l((function(){return n.current&&o(n.current,de),function(){n.current&&i(n.current,de)}}),[n,o,i]),v(t,{ref:function(e){n.current=e}})},ue=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},he=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.hiddenColumns,l=t.hoveredIndex,c=t.isWidthDragging,d=t.onExpandRowClick,s=t.pinned,u=t.ref,h=t.rowHeight,v=t.rowIndices,p=t.setHoveredIndex,m=t.templateColumns,w=t.totalHeight,C=t.visibleRows,y=t.width,b=s?"st-body-pinned-".concat(s):"st-body-main";return e(ue,g({condition:!s,wrapper:function(n){return e(se,g({childRef:u},{children:n}))}},{children:e("div",g({className:b,ref:u,style:g({position:"relative",height:"".concat(w,"px"),width:y},!s&&{flexGrow:1})},{children:C.map((function(t,u){var g,w,y=C[u-1],b=Boolean((null==y?void 0:y.depth)!==(null==t?void 0:t.depth)&&(null===(w=null===(g=null==t?void 0:t.row.rowMeta)||void 0===g?void 0:g.children)||void 0===w?void 0:w.length)&&0===t.depth);return n(f,{children:[0!==u&&e(le,{displayStrongBorder:b,position:t.position,rowHeight:h,templateColumns:m}),e(ae,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:m,headers:i,hiddenColumns:a,hoveredIndex:l,index:u,isWidthDragging:c,onExpandRowClick:d,pinned:s,rowHeight:h,rowIndices:v,setHoveredIndex:p,visibleRow:t})]},t.position)}))}))}))};function fe(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return I({hiddenColumns:t,header:e})})).forEach((function(e,n){l(e,0===n)}))};return r.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&I({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;l(e,t)})),o.forEach((function(e){l(e,!1)})),i}var ve=function(t){var r=t.flattenedRows,a=t.headerContainerRef,d=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,p=t.pinnedRightTemplateColumns,m=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,y=t.visibleRows,b=D(),I=b.headersRef,x=b.hiddenColumns,R=b.mainBodyRef,E=b.rowHeight,N=b.scrollbarWidth,k=b.tableBodyContainerRef,S=o(null),M=S[0],W=S[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],c=i[1];l((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]),l((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;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:a,mainSectionRef:k,scrollbarWidth:N});var F,L,H=i(null),B=(F=0,(L=function(e){e.forEach((function(e){F+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&L(e.rowMeta.children)}))})(r),F)*(E+1)-1,T=c((function(){return fe({headersRef:I,hiddenColumns:x,pinnedLeftColumns:u,pinnedRightColumns:v})}),[I,x,u,v]),O=c((function(){var e={};return y.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[y]),P=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?g(g({},t),{rowMeta:g(g({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?g(g({},t),{rowMeta:g(g({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},A={columnIndices:T,headerContainerRef:a,headers:I.current,hiddenColumns:x,hoveredIndex:M,isWidthDragging:d,rowHeight:E,rowIndices:O,setHoveredIndex:W,visibleRows:y};return n("div",g({className:"st-body-container",onMouseLeave:function(){return W(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame((function(){C(n)}))},ref:k},{children:[u.length>0&&e(he,g({},A,{onExpandRowClick:P,pinned:"left",templateColumns:h,totalHeight:B,width:f})),e(he,g({},A,{columnIndexStart:u.length,onExpandRowClick:P,ref:R,templateColumns:s,totalHeight:B})),v.length>0&&e(he,g({},A,{columnIndexStart:u.length+s.length,onExpandRowClick:P,pinned:"right",templateColumns:p,totalHeight:B,width:m}))]}))},pe=function(e){return void 0===e&&(e=0),e?e+1:0},me=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,l=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:R(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=E(e))})))})),n.pinned?pe(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(l):"right"===n.pinned?a(l):n.pinned||o(l)},ge=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,l=e.setIsWidthDragging,c=e.setMainBodyWidth,d=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;l(!0),n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,f="touches"in n;if(i&&!i.hide){var v=k(i),p=r-o>1,m=p?R(i):[i],g=function(e){var n="right"===i.pinned?h-e:e-h;if(p&&m.length>1)we({delta:n,header:i,headersRef:a,leafHeaders:m,minWidth:v,setMainBodyWidth:c,setPinnedLeftWidth:d,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,v);i.width=r,me({header:i,headers:a.current,newWidth:r,setMainBodyWidth:c,setPinnedLeftWidth:d,setPinnedRightWidth:s})}a.current.forEach((function(e){N(e)})),t()};if(f){var w=function(e){var n=e.touches[0];g(n.clientX)},C=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",C),l(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",C)}else{var y=function(e){g(e.clientX)},b=function(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b),l(!1)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",b)}}},we=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,l=e.setPinnedLeftWidth,c=e.setPinnedRightWidth,d=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,k(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(d+n,s);me({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:l,setPinnedRightWidth:c});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},Ce=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"})}))},ye={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"},be=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"]}},Ie=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},xe=function(e){return["between","notBetween","in","notIn"].includes(e)},Re=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ee=function(n){var t=n.children;return e("div",g({className:"st-filter-container"},{children:t}))},Ne=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"})}))},ke=function(t){var r=t.value,a=t.onChange,c=t.options,d=t.placeholder,s=void 0===d?"Select...":d,u=t.className,h=void 0===u?"":u,f=t.disabled,v=void 0!==f&&f,p=o(!1),m=p[0],w=p[1],C=o(-1),y=C[0],b=C[1],I=i(null),x=i(null),R=c.find((function(e){return e.value===r}));l((function(){var e=function(e){I.current&&!I.current.contains(e.target)&&(w(!1),b(-1))};if(m)return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}),[m]),l((function(){var e=function(e){if(m)switch(e.key){case"ArrowDown":e.preventDefault(),b((function(e){return e<c.length-1?e+1:0}));break;case"ArrowUp":e.preventDefault(),b((function(e){return e>0?e-1:c.length-1}));break;case"Enter":e.preventDefault(),y>=0&&(a(c[y].value),w(!1),b(-1));break;case"Escape":e.preventDefault(),w(!1),b(-1)}};if(m)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[m,y,c,a]),l((function(){if(m&&y>=0&&x.current){var e=x.current.children[y];e&&e.scrollIntoView({block:"nearest"})}}),[y,m]);return n("div",g({ref:I,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)b(-1);else{var e=c.findIndex((function(e){return e.value===r}));b(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:R?R.label:s})),e(Ne,{})]})),m&&e("div",g({ref:x,className:"st-custom-select-dropdown",role:"listbox"},{children:c.map((function(n,t){return e("div",g({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===y?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void b(-1);var e}},{children:n.label}),n.value)}))}))]}))},Se=function(n){var t=n.value,r=n.onChange,o=n.operators.map((function(e){return{value:e,label:ye[e]}}));return e("div",g({className:"st-filter-section"},{children:e(ke,{value:t,onChange:function(e){r(e)},options:o})}))},Me=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,d=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===d?"":d).trim()})},We=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}))},De=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"}))]}))},Fe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,c=t.onClearFilter,d=o((null==i?void 0:i.operator)||"contains"),s=d[0],u=d[1],h=o((null==i?void 0:i.value)||""),f=h[0],v=h[1],p=be("string");l((function(){i?(u(i.operator),v(i.value||"")):(u("contains"),v(""))}),[i]);var m=Re(s)||f.trim();return n(Ee,{children:[e(Se,{value:s,onChange:u,operators:p}),Ie(s)&&e(We,{children:e(Me,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0})}),e(De,{onApply:function(){var e=g({accessor:r.accessor,operator:s},Ie(s)&&{value:f});a(e)},onClear:c,canApply:!!m,showClear:!!i})]})},Le=function(t){var r,i,a=t.header,c=t.currentFilter,d=t.onApplyFilter,s=t.onClearFilter,u=o((null==c?void 0:c.operator)||"equals"),h=u[0],f=u[1],v=o((null==c?void 0:c.value)||""),p=v[0],m=v[1],g=o((null===(r=null==c?void 0:c.values)||void 0===r?void 0:r[0])||""),w=g[0],C=g[1],y=o((null===(i=null==c?void 0:c.values)||void 0===i?void 0:i[1])||""),b=y[0],I=y[1],x=be("number");l((function(){var e,n;c?(f(c.operator),m(c.value||""),C((null===(e=c.values)||void 0===e?void 0:e[0])||""),I((null===(n=c.values)||void 0===n?void 0:n[1])||"")):(f("equals"),m(""),C(""),I(""))}),[c]);return n(Ee,{children:[e(Se,{value:h,onChange:f,operators:x}),Ie(h)&&e(We,{children:e(Me,{type:"number",value:p,onChange:m,placeholder:"Enter number...",autoFocus:!0})}),xe(h)&&n(We,{children:[e(Me,{type:"number",value:w,onChange:C,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e(Me,{type:"number",value:b,onChange:I,placeholder:"To..."})]}),e(De,{onApply:function(){var e={accessor:a.accessor,operator:h};Ie(h)?e.value=parseFloat(p):xe(h)&&(e.values=[parseFloat(w),parseFloat(b)]),d(e)},onClear:s,canApply:!!Re(h)||(Ie(h)?""!==p.trim():!!xe(h)&&""!==w.trim()&&""!==b.trim()),showClear:!!c})]})},He=function(n){var t=n.value,r=n.onChange,o=n.options;n.autoFocus;var i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(ke,{value:t,onChange:r,options:o,className:a,placeholder:l})},Be=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,c=t.onClearFilter,d=o((null==i?void 0:i.operator)||"equals"),s=d[0],u=d[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=be("boolean");l((function(){i?(u(i.operator),v(void 0!==i.value?String(i.value):"true")):(u("equals"),v("true"))}),[i]);var m=Re(s)||""!==f;return n(Ee,{children:[e(Se,{value:s,onChange:u,operators:p}),Ie(s)&&e(We,{children:e(He,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}],autoFocus:!0})}),e(De,{onApply:function(){var e={accessor:r.accessor,operator:s};Ie(s)&&(e.value="true"===f),a(e)},onClear:c,canApply:m,showClear:!!i})]})},Te=function(t){var r,i,a=t.header,c=t.currentFilter,d=t.onApplyFilter,s=t.onClearFilter,u=o((null==c?void 0:c.operator)||"equals"),h=u[0],f=u[1],v=o((null==c?void 0:c.value)||""),p=v[0],m=v[1],g=o((null===(r=null==c?void 0:c.values)||void 0===r?void 0:r[0])||""),w=g[0],C=g[1],y=o((null===(i=null==c?void 0:c.values)||void 0===i?void 0:i[1])||""),b=y[0],I=y[1],x=be("date");l((function(){var e,n;c?(f(c.operator),m(c.value||""),C((null===(e=c.values)||void 0===e?void 0:e[0])||""),I((null===(n=c.values)||void 0===n?void 0:n[1])||"")):(f("equals"),m(""),C(""),I(""))}),[c]);return n(Ee,{children:[e(Se,{value:h,onChange:f,operators:x}),Ie(h)&&e(We,{children:e(Me,{type:"date",value:p,onChange:m,placeholder:"Select date...",autoFocus:!0})}),xe(h)&&n(We,{children:[e(Me,{type:"date",value:w,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(Me,{type:"date",value:b,onChange:I,placeholder:"To date..."})]}),e(De,{onApply:function(){var e={accessor:a.accessor,operator:h};Ie(h)?e.value=p:xe(h)&&(e.values=[w,b]),d(e)},onClear:s,canApply:!!Re(h)||(Ie(h)?""!==p.trim():!!xe(h)&&""!==w.trim()&&""!==b.trim()),showClear:!!c})]})},Oe=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"})}))},Pe=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(Oe,{className:"st-checkbox-checkmark"})})),i]}))},Ae=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,d=t.onClearFilter,s=c((function(){return r.enumOptions||[]}),[r.enumOptions]),u=c((function(){return s.map((function(e){return e.value}))}),[s]),h=o((null==i?void 0:i.values)||u),f=h[0],v=h[1];l((function(){v(i?i.values||[]:u)}),[i,u]);var p=f.length===u.length;return n(Ee,{children:[e(We,{children:n("div",g({className:"st-enum-filter-options"},{children:[e("div",g({className:"st-enum-select-all"},{children:e(Pe,g({checked:p,onChange:function(e){v(e?u:[])}},{children:e("span",g({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),s.map((function(n){return e(Pe,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})):y(y([],n,!0),[e],!1)}));var e}},{children:e("span",g({className:"st-enum-option-label"},{children:n.label}))}),n.value)}))]}))}),e(De,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else d()},onClear:d,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},qe=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(Be,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(Te,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(Ae,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Fe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},je=u((function(t,r){var i,a,c=t.colIndex,d=t.forceHeadersUpdate,s=t.gridColumnEnd,u=t.gridColumnStart,h=t.gridRowEnd,f=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,w=o(!1),C=w[0],I=w[1],x=D(),R=x.columnReordering,E=x.columnResizing,N=x.draggedHeaderRef,k=x.filters,S=x.forceUpdate,M=x.handleApplyFilter,W=x.handleClearFilter,F=x.headersRef,L=x.hoveredHeaderRef,H=x.onColumnOrderChange,B=x.onSort,T=x.onTableHeaderDragEnd,O=x.rowHeight,A=x.selectColumns,q=x.selectableColumns,j=x.setInitialFocusedCell,z=x.setIsWidthDragging,U=x.setMainBodyWidth,Y=x.setPinnedLeftWidth,J=x.setPinnedRightWidth,V=x.setSelectedCells,X=x.setSelectedColumns,K=x.sortDownIcon,$=x.sortUpIcon,_=Boolean(null==v?void 0:v.isSortable),Q=Boolean(null==v?void 0:v.filterable),ee=k[v.accessor],ne="st-header-cell ".concat(v.accessor===(null===(i=L.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=N.current)||void 0===a?void 0:a.accessor)===v.accessor?"st-dragging":""," ").concat(_?"clickable":""," ").concat(R&&!_?"columnReordering":""," ").concat(v.children?"parent":""),te=Z({draggedHeaderRef:N,headersRef:F,hoveredHeaderRef:L,onColumnOrderChange:H,onTableHeaderDragEnd:T}),re=te.handleDragStart,oe=te.handleDragEnd,ie=te.handleDragOver,ae=G(),le=function(e){var n=e.event,t=e.header;if(q){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,c);return n.shiftKey&&A?X((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,d,s=y(y([],(a=o,l=n,c=Math.min(a,l),d=Math.max(a,l),Array.from({length:d-c+1},(function(e,n){return c+n}))),!0),r,!0);return new Set(y(y([],Array.from(e),!0),s,!0))})):A&&A(r),V(new Set),void j(null)}t.isSortable&&B(c,t.accessor)};if(l((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 ce=E&&e("div",g({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;ae({callback:ge,callbackProps:{event:e.nativeEvent,forceUpdate:S,gridColumnEnd:s,gridColumnStart:u,header:v,headersRef:F,setIsWidthDragging:z,setMainBodyWidth:U,setPinnedLeftWidth:Y,setPinnedRightWidth:J,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;ae({callback:ge,callbackProps:{event:e,forceUpdate:S,gridColumnEnd:s,gridColumnStart:u,header:v,headersRef:F,setIsWidthDragging:z,setMainBodyWidth:U,setPinnedLeftWidth:Y,setPinnedRightWidth:J,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"})})),de=m&&m.key.accessor===v.accessor&&n("div",g({className:"st-sort-icon-container",onClick:function(e){return le({event:e,header:v})}},{children:["ascending"===m.direction&&$&&$,"descending"===m.direction&&K&&K]})),se=Q&&n("div",g({className:"st-filter-icon-container",onClick:function(e){e.stopPropagation(),I(!C)},style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer",padding:"2px"}},{children:[e(Ce,{className:"st-filter-icon",style:{width:"12px",height:"12px",fill:ee?"var(--st-button-active-background-color)":"var(--st-slate-500)"}}),e(P,g({open:C,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(qe,{header:v,currentFilter:ee,onApplyFilter:function(e){M(e),I(!1)},onClearFilter:function(){W(v.accessor),I(!1)}})}))]}));return n("div",g({className:ne,id:b({accessor:v.accessor,rowIndex:0}),onDragOver:function(e){ae({callback:ie,callbackProps:{event:e,hoveredHeader:v},limit:50})},ref:r,style:g(g({gridRowStart:f,gridRowEnd:h,gridColumnStart:u,gridColumnEnd:s},s-u>1?{}:{width:v.width}),h-f>1?{}:{height:O})},{children:[p&&ce,"right"===v.align&&de,"right"===v.align&&se,e("div",g({className:"st-header-label",draggable:R&&!v.disableReorder,onClick:function(e){return le({event:e,header:v})},onDragEnd:function(e){e.preventDefault(),oe(),d()},onDragStart:function(e){R&&v&&function(e){re(e)}(v)}},{children:e("span",g({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:null==v?void 0:v.label}))})),"right"!==v.align&&de,"right"!==v.align&&se,!p&&ce]}))})),ze=function(n){var t=n.columnIndices,r=n.gridTemplateColumns,o=n.handleScroll,i=n.headersRef,a=n.hiddenColumns,l=n.maxDepth,d=n.pinned,s=n.sectionRef,u=n.sort,h=p((function(e){return e+1}),0)[1],f=c((function(){var e=[],n=1,r=function(o,i,c){var s,u;if(void 0===c&&(c=!1),!I({hiddenColumns:a,header:o,pinned:d}))return 0;c||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return I({hiddenColumns:a,header:e,pinned:d})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,p=i,m=h>0?i+1:l+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:p,gridRowEnd:m,colIndex:t[o.accessor]}),o.children){var g=!0;o.children.forEach((function(e){I({hiddenColumns:a,header:e,pinned:d})&&(r(e,i+1,g),g=!1)}))}return v-f},o=i.current.filter((function(e){return I({hiddenColumns:a,header:e,pinned:d})})),c=!0;return o.forEach((function(e){r(e,1,c),c=!1})),e}),[i,a,l,d,t]);return e(ue,g({condition:!d,wrapper:function(n){return e(se,g({childRef:s},{children:n}))}},{children:e("div",g({className:"st-header-".concat(d?"pinned-".concat(d):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:r,display:"grid",position:"relative"}},{children:e(te,g({rowIndex:0},{children:f.map((function(n){return e(je,{colIndex:n.colIndex,forceHeadersUpdate:h,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:m(),reverse:"right"===d,sort:u},n.header.accessor)}))}))}))}))},Ue=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ue)):1},Ye=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,l=t.mainTemplateColumns,d=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,f=t.pinnedRightTemplateColumns,v=t.sort,p=D(),m=p.pinnedLeftRef,w=p.pinnedRightRef,C=p.setPinnedLeftWidth,y=p.setPinnedRightWidth,b=c((function(){return fe({headersRef:i,hiddenColumns:a,pinnedLeftColumns:d,pinnedRightColumns:u})}),[i,a,d,u]),x=c((function(){var e=i.current,n=0;return e.forEach((function(e){if(I({hiddenColumns:a,header:e})){var t=Ue(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return h((function(){var e,n;C(pe(null===(e=m.current)||void 0===e?void 0:e.clientWidth)),y(pe(null===(n=w.current)||void 0===n?void 0:n.clientWidth))}),[m,w,C,y]),n("div",g({className:"st-header-container",ref:o},{children:[d.length>0&&e(ze,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,pinned:"left",sectionRef:m,sort:v}),e(ze,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,sectionRef:r,sort:v}),u.length>0&&e(ze,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,pinned:"right",sectionRef:w,sort:v})]}))},Je=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},Ve=function(t){var r=t.flattenedRows,o=t.isWidthDragging,a=t.pinnedLeftWidth,l=t.pinnedRightWidth,d=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=D(),v=f.columnResizing,p=f.editColumns,m=f.headersRef,w=f.hiddenColumns,C=i(null),y=i(null),b=m.current.filter((function(e){return!e.pinned})),I=m.current.filter((function(e){return"left"===e.pinned})),x=m.current.filter((function(e){return"right"===e.pinned})),R=c((function(){return Je({headers:I,hiddenColumns:w})}),[I,w]),E=c((function(){return Je({headers:b,hiddenColumns:w})}),[b,w]),N=c((function(){return Je({headers:x,hiddenColumns:w})}),[x,w]),k={centerHeaderRef:y,headerContainerRef:C,headersRef:m,hiddenColumns:w,mainTemplateColumns:E,pinnedLeftColumns:I,pinnedLeftTemplateColumns:R,pinnedRightColumns:x,pinnedRightTemplateColumns:N,sort:u},S={flattenedRows:r,headerContainerRef:C,isWidthDragging:o,mainTemplateColumns:E,pinnedLeftColumns:I,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:x,pinnedRightTemplateColumns:N,pinnedRightWidth:l,setFlattenedRows:d,setScrollTop:s,visibleRows:h};return n("div",g({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:p?"calc(100% - 27.5px)":"100%"}},{children:[e(Ye,g({},k)),e(ve,g({},S))]}))},Xe=function(t){var r,a,c=t.mainBodyWidth,d=t.mainBodyRef,s=t.pinnedLeftWidth,u=t.pinnedRightWidth,h=t.setMainBodyWidth,f=t.tableBodyContainerRef,v=D().editColumns,p=o(!1),m=p[0],w=p[1],C=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=v?28:0,I=(v?u+1:u)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return l((function(){setTimeout((function(){!function(){var e;if(d.current){var n=null===(e=d.current)||void 0===e?void 0:e.scrollWidth;h(n||0)}}()}),1)}),[d,h]),l((function(){setTimeout((function(){!function(){if(d.current){var e=d.current.clientWidth;w(c>e)}}()}),1)}),[d,c,h]),m?n("div",g({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=C.current)||void 0===r?void 0:r.offsetHeight}}),c>0&&e(se,g({childRef:C},{children:e("div",g({className:"st-horizontal-scrollbar-middle",ref:C,style:{flexGrow:1}},{children:e("div",{style:{width:c,height:".3px"}})}))})),u>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:I,height:null===(a=C.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},Ge={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 Ge.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?Ge.string(e,n,t):"number"==typeof e&&"number"==typeof n?Ge.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Ge.boolean(e,n,t):Ge.string(String(e),String(n),t)}},Ke=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 Ge.number(i,a,r)}return"date"===t?Ge.date(String(e),String(n),r):"boolean"===t?Ge.boolean(Boolean(e),Boolean(n),r):"enum"===t?Ge.enum(String(e),String(n),r):Ge.string(String(e),String(n),r)},$e=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,l=new Map,c="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();c=r,l.set(c,e),a.has(c)||a.set(c,[])}else if(c){var o=a.get(c)||[];o.push(e),a.set(c,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(t=a.get(i))||void 0===t||t.push(e)}}));var d=[];return a.forEach((function(e,r){if(l.has(r)){var a=l.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=_e(a.rowMeta.children,n,t)),d.push(a)}var c=y([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],l=t.rowData[r];return Ke(a,l,o,i)}));d.push.apply(d,c.map((function(e){var r=g({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=_e(r.rowMeta.children,n,t);r.rowMeta=g(g({},r.rowMeta),{children:o})}return r})))})),d},_e=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 y([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],l=t.rowData[r];return Ke(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:_e(e.rowMeta.children,n,t)})}):e}))},Qe=function(e){var n=e.headers,t=e.tableRows,r=o(null),i=r[0],a=r[1],l=c((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),d=o(l),s=d[0],u=d[1],h=c((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:$e(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Ze=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var l=a.children.some((function(e){return e.accessor===n})),c=!1;if(!l)for(var d=0,s=a.children;d<s.length;d++){var u=s[d];if(Ze([u],n,t,r),!1===t[u.accessor]){c=!0;break}}(l||c)&&(t[a.accessor]=!1)}}},en=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},nn=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(nn(e.children,n),en(e.children,n)&&(n[e.accessor]=!0))}))},tn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.header,d=r.hiddenColumns,s=r.setHiddenColumns,u=o(!0),h=u[0],f=u[1],v=D(),p=v.expandIcon,m=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,y=v.setPinnedLeftWidth,b=v.setPinnedRightWidth,I="".concat(16*l,"px"),x=c.children&&c.children.length>0,N=d[c.accessor]||x&&c.children&&en(c.children,d);return n(t,{children:[n("div",g({className:"st-header-checkbox-item",style:{paddingLeft:I}},{children:[e("div",g({className:"st-header-icon-container"},{children:x?e("div",g({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?m:p})):null})),e(Pe,g({checked:N,onChange:function(e){var n=g({},d);(n[c.accessor]=e,e)?nn(i,n):(Ze(i,c.accessor,n),x&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===d[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,Ze(i,c.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,l=0;n.forEach((function(e){if(!e.hide){var n=R(e).reduce((function(e,n){return e+E(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:l+=n}}));var c=pe(i),d=pe(a);r(c),o(d),t(l)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:y,setPinnedRightWidth:b})}},{children:c.label}))]})),x&&h&&c.children&&e("div",g({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e(tn,{allHeaders:i,depth:l+1,header:n,hiddenColumns:d,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},rn=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,l="left"===o?"left":"";return e("div",g({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:e("div",g({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(tn,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},on=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.hiddenColumns,d=t.position,s=void 0===d?"right":d,u=t.setHiddenColumns,h=o(a),f=h[0],v=h[1];return i?n("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",g({className:"st-column-editor-text"},{children:r})),e(rn,{headers:l,open:f,position:s,setHiddenColumns:u,hiddenColumns:c})]})):null},an=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"})}))},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:"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"})}))},cn=function(n){var t=n.children,o=i({}),l=a((function(e,n){return!!o.current[n]&&o.current[n].find((function(n){return n===e}))}),[]),c=a((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),d=a((function(e){e.onscroll=null}),[]),s=a((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&&(d(n),c(e,n),window.requestAnimationFrame((function(){var e=Object.keys(o.current).filter((function(e){return o.current[e].includes(n)}));s(n,e)})))}))}))}))}}),[d,c]),u=a((function(e,n){n.forEach((function(n){o.current[n]||(o.current[n]=[]),l(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))})),s(e,n)}),[l,c,s]),h=a((function(e,n){n.forEach((function(n){if(l(e,n)){d(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}}))}),[l,d]);return e(ce.Provider,g({value:{registerPane:u,unregisterPane:h}},{children:r.Children.only(t)}))},dn=function(e,n){var t=n.find((function(n){return n.accessor===e.accessor})),r=(null==t?void 0:t.label)||e.accessor,o=ye[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)},sn=function(){var t=D(),r=t.filters,o=t.handleClearFilter,i=t.headersRef,a=Object.values(r);return 0===a.length?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:dn(t,i.current)})),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)}))}))}))}))},un=function(n){var t=o(!1),r=t[0],i=t[1];return l((function(){i(!0)}),[]),r?e(hn,g({},n)):null},hn=function(t){var r=t.allowAnimations,d=void 0!==r&&r,s=t.cellUpdateFlash,u=void 0!==s&&s,f=t.collapseIcon,v=void 0===f?e(B,{className:"st-sort-icon"}):f,m=t.columnEditorPosition,w=void 0===m?"right":m,C=t.columnEditorText,y=void 0===C?"Columns":C,b=t.columnReordering,I=void 0!==b&&b,E=t.columnResizing,N=void 0!==E&&E,k=t.defaultHeaders,M=t.editColumns,D=void 0!==M&&M,T=t.editColumnsInitOpen,O=void 0!==T&&T,P=t.expandIcon,A=void 0===P?e(H,{className:"st-sort-icon"}):P,q=t.height,j=t.hideFooter,z=void 0!==j&&j,U=t.nextIcon,Y=void 0===U?e(H,{className:"st-next-prev-icon"}):U,J=t.onCellEdit,V=t.onColumnOrderChange,X=t.onGridReady,G=t.onNextPage,K=t.prevIcon,$=void 0===K?e(L,{className:"st-next-prev-icon"}):K,_=t.rowHeight,Q=void 0===_?40:_,Z=t.rows,ee=t.rowsPerPage,ne=void 0===ee?10:ee,te=t.selectableCells,re=void 0!==te&&te,oe=t.selectableColumns,ie=void 0!==oe&&oe,ae=t.shouldPaginate,le=void 0!==ae&&ae,ce=t.sortDownIcon,de=void 0===ce?e(an,{className:"st-sort-icon"}):ce,se=t.sortUpIcon,ue=void 0===se?e(ln,{className:"st-sort-icon"}):se,he=t.tableRef,fe=t.theme,ve=void 0===fe?"light":fe,pe=t.useHoverRowBackground,me=void 0===pe||pe,ge=t.useOddEvenRowBackground,we=void 0===ge||ge,Ce=t.useOddColumnBackground,ye=void 0!==Ce&&Ce;ye&&(we=!1);var be=i(null),Ie=i(k),xe=i(null),Re=i(null),Ee=i(null),Ne=i(null),ke=i(null),Se=o(1),Me=Se[0],We=Se[1],De=o(!1),Fe=De[0],Le=De[1],He=o(0),Be=He[0],Te=He[1],Oe=o(0),Pe=Oe[0],Ae=Oe[1],qe=o(0),je=qe[0],ze=qe[1],Ue=o(0),Ye=Ue[0],Je=Ue[1],Ge=o(0),Ke=Ge[0],$e=Ge[1],_e=o({}),Ze=_e[0],en=_e[1],nn=a((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 d=o.map(Number),s=d[0],u=d[1];return l>=s&&l<=u}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);s=h[0],u=h[1];return l<s||l>u}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=new Date(e),v=new Date(r);switch(t){case"equals":return f.toDateString()===v.toDateString();case"notEquals":return f.toDateString()!==v.toDateString();case"before":return f<v;case"after":return f>v;case"between":if(o&&2===o.length){var p=o.map((function(e){return new Date(e)})),m=p[0],g=p[1];return f>=m&&f<=g}return!1;case"notBetween":if(o&&2===o.length){var w=o.map((function(e){return new Date(e)}));m=w[0],g=w[1];return f<m||f>g}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),b=o.includes(y);return"in"===t?b:!b}return!1}var I=String(e).toLowerCase(),x=r?String(r).toLowerCase():"";switch(t){case"equals":return I===x;case"notEquals":return I!==x;default:return!0}}),[]),tn=c((function(){return 0===Object.keys(Ze).length?Z:Z.filter((function(e){return Object.values(Ze).every((function(n){try{var t=e.rowData[n.accessor];return nn(t,n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}}))}))}),[Z,Ze,nn]),rn=a((function(e){en((function(n){var t;return g(g({},n),((t={})[e.accessor]=e,t))}))}),[]),dn=a((function(e){en((function(n){var t=g({},n);return delete t[e],t}))}),[]),un=a((function(){en({})}),[]),hn=Qe({headers:Ie.current,tableRows:tn}),fn=hn.sort,vn=hn.sortedRows,pn=hn.hiddenColumns,mn=hn.setHiddenColumns,gn=hn.updateSort;l((function(){null==X||X()}),[X]);var wn=c((function(){if(!le)return vn;var e=(Me-1)*ne,n=e+ne;return vn.slice(e,n)}),[Me,ne,le,vn]),Cn=o(wn),yn=Cn[0],bn=Cn[1];l((function(){bn(wn)}),[wn]);var In=c((function(){var e;if(!q)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),t=0;if(q.endsWith("px"))t=parseInt(q,10);else if(q.endsWith("vh")){var r=parseInt(q,10);t=window.innerHeight*r/100}else if(q.endsWith("%")){var o=parseInt(q,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-Q)}),[q,Q]),xn=c((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,d=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=c*a;if(h>=s)break;h+a>d&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),l}({bufferRowCount:5,contentHeight:In,flattenedRows:yn,rowHeight:Q,scrollTop:Ye})}),[In,Q,yn,Ye]),Rn=p((function(e){return e+1}),0)[1],En=function(e){var n=e.selectableCells,t=e.headers,r=e.visibleRows,d=o(new Set),s=d[0],u=d[1],h=o(new Set),f=h[0],v=h[1],p=o(null),m=p[0],g=p[1],w=o(null),C=w[0],y=w[1],b=i(!1),I=i(null),x=a((function(){var e=t.flatMap(R).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var o=Array.from(s).reduce((function(e,t){var o=t.split("-").map(Number),i=o[0],a=o[1];e[i]||(e[i]=[]);var l=n.get(a);return e[i][a]=l?r[i].row.rowData[l]:"",e}),{}),i=Object.values(o).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(i)}),[t,s,r]),E=a((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 d=a;d<=l;d++)if(c>=0&&c<r.length){var s=r[c].row.rowMeta.rowId;t.add(S({colIndex:d,rowIndex:c,rowId:s}))}v(new Set),g(null),u(t)}),[r,v,g,u]),N=a((function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<t.length){var n=S(e);v(new Set),g(null),u(new Set([n])),y(e)}}),[t.length,r.length,v,g,u,y]),k=a((function(e,n){void 0===n&&(n=!1),u(new Set),y(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&g(e[e.length-1])}),[u,y,v,g]);l((function(){var e=function(e){if(n&&C){var o=C.rowIndex,i=C.colIndex,a=C.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(r[o].row.rowMeta.rowId!==a){var l=r.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c={rowIndex:o-1,colIndex:i,rowId:r[o-1].row.rowMeta.rowId};N(c)}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c={rowIndex:o+1,colIndex:i,rowId:r[o+1].row.rowMeta.rowId},N(c))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c={rowIndex:o,colIndex:i-1,rowId:r[o].row.rowMeta.rowId},N(c))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(c={rowIndex:o,colIndex:i+1,rowId:r[o].row.rowMeta.rowId},N(c))):"Escape"===e.key&&(u(new Set),v(new Set),g(null),I.current=null,y(null))}else x()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[x,t.length,C,E,N,n,r]);var M=a((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=S({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),W=a((function(e){var n,t,o,i,a,l,c=e.colIndex,d=e.rowIndex,s=e.rowId,u=[],h=null===(o=null===(t=null===(n=r[d-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===o?void 0:o.rowId,v={colIndex:c,rowIndex:d+1,rowId:null===(l=null===(a=null===(i=r[d+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},p={colIndex:c-1,rowIndex:d,rowId:s},m={colIndex:c+1,rowIndex:d,rowId:s};return(!M({colIndex:c,rowIndex:d-1,rowId:h})||f.has(c)&&0===d)&&u.push("st-selected-top-border"),(!M(v)||f.has(c)&&d===r.length-1)&&u.push("st-selected-bottom-border"),M(p)||u.push("st-selected-left-border"),M(m)||u.push("st-selected-right-border"),u.join(" ")}),[M,r,f]),D=c((function(){return C?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===C.rowIndex&&t===C.colIndex&&r===C.rowId}:function(){return!1}}),[C]);return{getBorderClass:W,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){b.current=!0,I.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),g(null);var i=S({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),y({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&b.current&&I.current){for(var i=new Set,a=Math.min(I.current.rowIndex,o),l=Math.max(I.current.rowIndex,o),c=Math.min(I.current.colIndex,t),d=Math.max(I.current.colIndex,t),s=a;s<=l;s++)for(var h=c;h<=d;h++)if(s>=0&&s<r.length){var f=r[s].row.rowMeta.rowId;i.add(S({colIndex:h,rowIndex:s,rowId:f}))}u(i)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:D,isSelected:M,lastSelectedColumnIndex:m,selectColumns:k,selectedCells:s,selectedColumns:f,setInitialFocusedCell:y,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:re,headers:Ie.current,visibleRows:xn}),Nn=En.getBorderClass,kn=En.handleMouseDown,Sn=En.handleMouseOver,Mn=En.handleMouseUp,Wn=En.isInitialFocusedCell,Dn=En.isSelected,Fn=En.selectColumns,Ln=En.selectedCells,Hn=En.selectedColumns,Bn=En.setInitialFocusedCell,Tn=En.setSelectedCells,On=En.setSelectedColumns,Pn=a((function(e,n){gn(e,n)}),[gn]),An=a((function(e){Ie.current=e,Rn()}),[]);l((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(Ln.size>0&&Tn(new Set),Hn.size>0&&On(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,Ln,Hn,Tn,On]),h((function(){if(ke.current){var e=ke.current.offsetWidth-ke.current.clientWidth;$e(e)}}),[]),h((function(){var e=function(){if(Rn(),ke.current){var e=ke.current.offsetWidth-ke.current.clientWidth;$e(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var qn=i(new Map);return l((function(){he&&(he.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(t=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==c){var d=x({rowId:c,accessor:i}),s=qn.current.get(d);s&&s.updateContent(l),void 0!==(null===(o=null===(r=null==Z?void 0:Z[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=l)}}})}),[he,Z]),e(W,g({value:{allowAnimations:d,cellRegistry:qn.current,cellUpdateFlash:u,collapseIcon:v,columnReordering:I,columnResizing:N,draggedHeaderRef:be,editColumns:D,expandIcon:A,filters:Ze,forceUpdate:Rn,getBorderClass:Nn,handleApplyFilter:rn,handleClearFilter:dn,handleClearAllFilters:un,handleMouseDown:kn,handleMouseOver:Sn,headersRef:Ie,hiddenColumns:pn,hoveredHeaderRef:xe,isInitialFocusedCell:Wn,isSelected:Dn,mainBodyRef:Re,nextIcon:Y,onCellEdit:J,onColumnOrderChange:V,onSort:Pn,onTableHeaderDragEnd:An,pinnedLeftRef:Ee,pinnedRightRef:Ne,prevIcon:$,rowHeight:Q,scrollbarWidth:Ke,selectColumns:Fn,selectableColumns:ie,setInitialFocusedCell:Bn,setIsWidthDragging:Le,setMainBodyWidth:Te,setPinnedLeftWidth:Ae,setPinnedRightWidth:ze,setSelectedCells:Tn,setSelectedColumns:On,shouldPaginate:le,sortDownIcon:de,sortUpIcon:ue,tableBodyContainerRef:ke,theme:ve,useOddColumnBackground:ye,useHoverRowBackground:me,useOddEvenRowBackground:we}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(ve),style:q?{height:q}:{}},{children:e(cn,{children:n("div",g({className:"st-wrapper-container"},{children:[e(sn,{}),n("div",g({className:"st-content-wrapper",onMouseUp:Mn,onMouseLeave:Mn},{children:[e(Ve,{flattenedRows:yn,isWidthDragging:Fe,pinnedLeftWidth:Pe,pinnedRightWidth:je,setFlattenedRows:bn,setScrollTop:Je,sort:fn,visibleRows:xn}),e(on,{columnEditorText:y,editColumns:D,editColumnsInitOpen:O,headers:Ie.current,hiddenColumns:pn,position:w,setHiddenColumns:mn})]})),e(Xe,{mainBodyRef:Re,mainBodyWidth:Be,pinnedLeftWidth:Pe,pinnedRightWidth:je,setMainBodyWidth:Te,tableBodyContainerRef:ke}),e(F,{currentPage:Me,hideFooter:z,onPageChange:We,onNextPage:G,shouldPaginate:le,totalPages:Math.ceil(tn.length/ne)})]}))})}))}))};export{un 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,useCallback as a,useEffect as l,useMemo as c,createContext as d,useContext as s,forwardRef as u,Fragment as h,cloneElement as f,useReducer as v,createRef as p,useLayoutEffect 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 C(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 y(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 b=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},I=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},x=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},R=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return R(e)})):[e]},S=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(b({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},E=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(b({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},k=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},M=d(void 0),D=function(n){var t=n.children,r=n.value;return e(M.Provider,g({value:r},{children:t}))},W=function(){var e=s(M);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},F=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,d=t.totalPages,s=W(),u=s.nextIcon,h=s.prevIcon,f=o(!0),v=f[0],p=f[1],m=!(r>1),y=!(r<d)&&!l||!v&&r===d;if(i||!c)return null;var b=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 i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<d-1&&(t.push(-1),t.push(d)),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(y?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,(function(){var e,n;return C(this,(function(t){switch(t.label){case 0:return e=r===d,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<=d||l)&&a(n),[2]}}))}))},disabled:y},{children:u})),b.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<=d&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},H=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"})}))},L=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"})}))},T=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:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},B=function(e){return e.position*(e.rowHeight+1)-1},O=function(e){return e.position*(e.rowHeight+1)},P=function(n){var t=n.children,r=n.onClose,a=n.open,c=n.overflow,d=void 0===c?"auto":c,s=n.setOpen,u=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=W().mainBodyRef,m=i(null),w=i(null),C=o("bottom-left"),y=C[0],b=C[1],I=o({}),x=I[0],R=I[1],S=o(!1),E=S[0],N=S[1];return l((function(){a&&m.current?(N(!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=u||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 d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===d?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===d?c.left=0:c.right=0),b("".concat(l,"-").concat(d)),R(c),N(!0)}}))):a||N(!1)}),[a,u,h,p,v]),l((function(){var e=function(e){if(a&&m.current){var n=e.target;m.current&&!m.current.contains(n)&&(s(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[a,r,s]),l((function(){var e=function(e){m.current&&!m.current.contains(e.target)&&(s(!1),null==r||r())};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[r,a,s]),l((function(){var e=function(e){"Escape"===e.key&&a&&(s(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,a,s]),a?e("div",g({ref:m,className:"st-dropdown-content st-dropdown-".concat(y),onClick:function(e){return e.stopPropagation()},style:g(g({position:v,width:u?"".concat(u,"px"):"auto",visibility:E?"visible":"hidden"},x),{overflow:d})},{children:t})):null},A=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,d=void 0===c?"":c;return e("div",g({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(d),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},q=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,d=o(c),s=d[0],u=d[1],h=function(e){u(e),i(e),l(!1),r()};return n(P,g({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(A,g({isSelected:!0===s,onClick:function(){return h(!0)}},{children:"True"})),e(A,g({isSelected:!1===s,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)}})},U=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)}})},j=function(r){var i,a,l=r.onChange,c=r.onClose,d=r.value,s=W(),u=s.nextIcon,h=s.prevIcon,f=o(d||new Date),v=f[0],p=f[1],m=o("days"),w=m[0],C=m[1],y=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 C("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:u}))]}),"months"===w&&e("div",g({className:"st-datepicker-header-label",onClick:function(){return C("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=y(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=y(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 s=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)))},u=0;u<i;u++)s(u);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(d).getDate()&&r===new Date(d).getMonth()&&t===new Date(d).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)),C("days")}(t)}},{children:n}),"month-".concat(t)))})),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",g({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),C("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",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},X=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;l((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(){t()};return e(P,g({open:o,onClose:c,setOpen:i,width:280},{children:e(j,{value:Y(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:c})}))},K=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,d=o(c||""),s=d[0],u=d[1];return e(P,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(A,g({isSelected:s===n.value,onClick:function(){return e=n.value,u(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,d=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(q,{onBlur:d,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(X,{onBlur:d,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(K,{onBlur:d,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(U,{defaultValue:c,onBlur:d,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var s=null==c?"":String(c);return e(z,{defaultValue:s,onBlur:d,onChange:o})},G=0,J=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===G||o-G>=r)&&(G=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},_=Date.now(),Q={screenX:0,screenY:0},Z=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 y(y([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Z(o.children,n,y(y([],t,!0),[r],!1));if(i)return i}}return null};var ee=function(e){var n,t,r=e.draggedHeaderRef,o=e.headersRef,a=e.hoveredHeaderRef,c=e.onColumnOrderChange,d=e.onTableHeaderDragEnd,s=(n=o.current,t=i(n),l((function(){JSON.stringify(t.current)!==JSON.stringify(n)&&(t.current=n)}),[n]),t.current);return{handleDragStart:function(e){r.current=e,_=Date.now()},handleDragOver:function(e){var n,t,i=e.event,l=e.hoveredHeader;if(i.preventDefault(),o.current){var c=i.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=i.screenX,h=i.screenY,f=Math.sqrt(Math.pow(u-Q.screenX,2)+Math.pow(h-Q.screenY,2));a.current=l;var v=o.current,p=Z(v,(null===(n=r.current)||void 0===n?void 0:n.accessor)||""),m=Z(v,l.accessor);if(p&&m){var g=p.length,w=m.length,C=m;if(g!==w){var y=w-g;y>0&&(C=m.slice(0,-y))}var b=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}}(v,p,C),I=b.newHeaders,x=b.emergencyBreak;if(!(c||l.accessor===(null===(t=r.current)||void 0===t?void 0:t.accessor)||null===r.current||f<10||0===p.length||0===C.length||JSON.stringify(I)===JSON.stringify(o.current)||x)){var R=Date.now();JSON.stringify(I)===JSON.stringify(s)&&(R-_<1500||f<40)||(_=R,Q={screenX:u,screenY:h},d(I))}}}},handleDragEnd:function(){r.current=null,a.current=null,null==c||c(o.current)}}},ne=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},te=u((function(t,r){var c,d,s=t.borderClass,u=t.colIndex,h=t.header,f=t.isHighlighted,v=t.isInitialFocused,p=t.nestedIndex,m=t.onExpandRowClick,w=t.rowIndex,C=t.visibleRow,y=W(),I=y.cellRegistry,R=y.cellUpdateFlash,S=y.collapseIcon,E=y.draggedHeaderRef,N=y.expandIcon,k=y.handleMouseDown,M=y.handleMouseOver,D=y.headersRef,F=y.hoveredHeaderRef,H=y.onCellEdit,L=y.onTableHeaderDragEnd,T=y.theme,B=y.useOddColumnBackground,O=C.depth,P=C.row,A=o(P.rowData[h.accessor]),q=A[0],z=A[1],U=o(!1),j=U[0],Y=U[1],X=o(!1),K=X[0],G=X[1],$=i(null),_=ee({draggedHeaderRef:E,headersRef:D,hoveredHeaderRef:F,onTableHeaderDragEnd:L}).handleDragOver,Q=J(),Z="cell-".concat(w,"-").concat(u),te=x({rowId:P.rowMeta.rowId,accessor:h.accessor});l((function(){if(I){var e="".concat(P.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){q!==e?(z(e),R&&(G(!0),$.current&&clearTimeout($.current),$.current=setTimeout((function(){G(!1)}),800))):z(e)}}),function(){I.delete(e),$.current&&clearTimeout($.current)}}}),[I,R,P.rowMeta.rowId,h.accessor,q]),l((function(){if(K){var e=setTimeout((function(){G(!1)}),850);return function(){return clearTimeout(e)}}}),[K]),l((function(){z(P.rowData[h.accessor])}),[P.rowData,h.accessor]),l((function(){f||Y(!1)}),[f]);var re="boolean"===h.type||"date"===h.type||"enum"===h.type,oe=Boolean(null===(d=null===(c=P.rowMeta)||void 0===c?void 0:c.children)||void 0===d?void 0:d.length),ie=Boolean(null==h?void 0:h.isEditable),ae="st-cell ".concat(O>0&&h.expandable?"st-cell-depth-".concat(O):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ie?"clickable":""," ").concat(K?"st-cell-updating":""," ").concat(B?p%2==0?"even-column":"odd-column":""),le=a((function(e){z(e),P.rowData[h.accessor]=e,null==H||H({accessor:h.accessor,newValue:e,row:P,rowIndex:w})}),[h.accessor,H,P,w]);return j&&!re?e("div",g({className:"st-cell-editing",id:b({accessor:h.accessor,rowIndex:w+1})},{children:e(V,{enumOptions:h.enumOptions,onChange:le,setIsEditing:Y,type:h.type,value:q})})):n("div",g({className:ae,id:Z,onDoubleClick:function(){return h.isEditable&&Y(!0)},onMouseDown:function(){return k({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onMouseOver:function(){return M({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onDragOver:function(e){return Q({callback:_,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||j||(e.preventDefault(),Y(!0))},ref:r,"data-row-index":w,"data-col-index":u,"data-row-id":P.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&oe?P.rowMeta.isExpanded?e("div",g({className:"st-icon-container",onClick:function(){return m(P.rowMeta.rowId)}},{children:S})):e("div",g({className:"st-icon-container",onClick:function(){return m(P.rowMeta.rowId)}},{children:N})):null,e("span",g({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:e("span",{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:P,theme:T}):ne({content:q,header:h})})})),j&&re&&e(V,{enumOptions:h.enumOptions,onChange:le,setIsEditing:Y,type:h.type,value:q})]}),te)})),re=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.hiddenColumns;n.isWidthDragging;var l=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,s=n.rowIndices,u=n.visibleRow,h=i.filter((function(e){return I({hiddenColumns:a,header:e,pinned:c})}));return e(t,{children:h.map((function(n,t){return e(oe,{columnIndices:o,header:n,headers:i,hiddenColumns:a,nestedIndex:t+(null!=r?r:0),onExpandRowClick:l,pinned:c,rowIndex:d,rowIndices:s,visibleRow:u},b({accessor:n.accessor,rowIndex:d+1}))}))})},oe=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.hiddenColumns,a=n.nestedIndex,l=n.onExpandRowClick,c=n.pinned,d=n.rowIndex,s=n.rowIndices,u=n.visibleRow,f=t[r.accessor],v=W(),p=v.getBorderClass,m=v.isSelected,g=v.isInitialFocusedCell;if(r.children){var w=r.children.filter((function(e){return I({hiddenColumns:i,header:e,pinned:c})}));return e(h,{children:w.map((function(n){return e(oe,{columnIndices:t,header:n,headers:o,hiddenColumns:i,nestedIndex:a,onExpandRowClick:l,pinned:c,rowIndex:d,rowIndices:s,visibleRow:u},b({accessor:n.accessor,rowIndex:d+1}))}))})}var C={rowIndex:d,colIndex:f,rowId:u.row.rowMeta.rowId},y=p(C),x=m(C),R=g(C);return e(te,{borderClass:y,colIndex:f,header:r,isHighlighted:x,isInitialFocused:R,nestedIndex:a,onExpandRowClick:l,rowIndex:d,visibleRow:u},b({accessor:r.accessor,rowIndex:d+1}))},ie=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,l=n.hoveredIndex,c=n.index,d=n.isWidthDragging,s=n.onExpandRowClick,u=n.pinned,h=n.rowHeight,f=n.rowIndices,v=n.setHoveredIndex,p=n.visibleRow,m=W().useHoverRowBackground,w=p.position;return e("div",g({className:"st-row ".concat(w%2==0?"even":"odd"," ").concat(l===c&&m?"hovered":""),onMouseEnter:function(){v(c)},style:{gridTemplateColumns:o,top:O({position:w,rowHeight:h}),height:"".concat(h,"px")}},{children:e(re,{columnIndexStart:r,columnIndices:t,headers:i,hiddenColumns:a,isWidthDragging:d,onExpandRowClick:s,pinned:u,rowIndex:c,rowIndices:f,visibleRow:p},c)}))},ae=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,i=n.templateColumns;return e("div",g({className:"st-row-separator ".concat(t?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:B({position:r,rowHeight:o}),minWidth:"100%"}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},le=d(void 0),ce=["default"],de=function(e){var n=e.childRef,t=e.children,r=function(){var e=s(le);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return l((function(){return n.current&&o(n.current,ce),function(){n.current&&i(n.current,ce)}}),[n,o,i]),f(t,{ref:function(e){n.current=e}})},se=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},ue=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.hiddenColumns,l=t.hoveredIndex,c=t.isWidthDragging,d=t.onExpandRowClick,s=t.pinned,u=t.ref,f=t.rowHeight,v=t.rowIndices,p=t.setHoveredIndex,m=t.templateColumns,w=t.totalHeight,C=t.visibleRows,y=t.width,b=s?"st-body-pinned-".concat(s):"st-body-main";return e(se,g({condition:!s,wrapper:function(n){return e(de,g({childRef:u},{children:n}))}},{children:e("div",g({className:b,ref:u,style:g({position:"relative",height:"".concat(w,"px"),width:y},!s&&{flexGrow:1})},{children:C.map((function(t,u){var g,w,y=C[u-1],b=Boolean((null==y?void 0:y.depth)!==(null==t?void 0:t.depth)&&(null===(w=null===(g=null==t?void 0:t.row.rowMeta)||void 0===g?void 0:g.children)||void 0===w?void 0:w.length)&&0===t.depth);return n(h,{children:[0!==u&&e(ae,{displayStrongBorder:b,position:t.position,rowHeight:f,templateColumns:m}),e(ie,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:m,headers:i,hiddenColumns:a,hoveredIndex:l,index:u,isWidthDragging:c,onExpandRowClick:d,pinned:s,rowHeight:f,rowIndices:v,setHoveredIndex:p,visibleRow:t})]},t.position)}))}))}))};function he(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,l=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return I({hiddenColumns:t,header:e})})).forEach((function(e,n){l(e,0===n)}))};return r.forEach((function(e,n){l(e,0===n)})),n.current.filter((function(e){return!e.pinned&&I({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;l(e,t)})),o.forEach((function(e){l(e,!1)})),i}var fe=function(t){var r=t.flattenedRows,a=t.headerContainerRef,d=t.isWidthDragging,s=t.mainTemplateColumns,u=t.pinnedLeftColumns,h=t.pinnedLeftTemplateColumns,f=t.pinnedLeftWidth,v=t.pinnedRightColumns,p=t.pinnedRightTemplateColumns,m=t.pinnedRightWidth,w=t.setFlattenedRows,C=t.setScrollTop,y=t.visibleRows,b=W(),I=b.headersRef,x=b.hiddenColumns,R=b.mainBodyRef,S=b.rowHeight,E=b.scrollbarWidth,N=b.tableBodyContainerRef,k=o(null),M=k[0],D=k[1];!function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],c=i[1];l((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]),l((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;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(r),function(){r&&i.unobserve(r)}}}),[n,t])}({headerContainerRef:a,mainSectionRef:N,scrollbarWidth:E});var F,H,L=i(null),T=(F=0,(H=function(e){e.forEach((function(e){F+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&H(e.rowMeta.children)}))})(r),F)*(S+1)-1,B=c((function(){return he({headersRef:I,hiddenColumns:x,pinnedLeftColumns:u,pinnedRightColumns:v})}),[I,x,u,v]),O=c((function(){var e={};return y.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[y]),P=function(e){var n=function(t){return t.rowMeta.rowId===e&&t.rowMeta.children?g(g({},t),{rowMeta:g(g({},t.rowMeta),{isExpanded:!t.rowMeta.isExpanded})}):t.rowMeta.children?g(g({},t),{rowMeta:g(g({},t.rowMeta),{children:t.rowMeta.children.map(n)})}):t};w((function(e){return e.map(n)}))},A={columnIndices:B,headerContainerRef:a,headers:I.current,hiddenColumns:x,hoveredIndex:M,isWidthDragging:d,rowHeight:S,rowIndices:O,setHoveredIndex:D,visibleRows:y};return n("div",g({className:"st-body-container",onMouseLeave:function(){return D(null)},onScroll:function(e){var n=e.currentTarget.scrollTop;L.current&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame((function(){C(n)}))},ref:N},{children:[u.length>0&&e(ue,g({},A,{onExpandRowClick:P,pinned:"left",templateColumns:h,totalHeight:T,width:f})),e(ue,g({},A,{columnIndexStart:u.length,onExpandRowClick:P,ref:R,templateColumns:s,totalHeight:T})),v.length>0&&e(ue,g({},A,{columnIndexStart:u.length+s.length,onExpandRowClick:P,pinned:"right",templateColumns:p,totalHeight:T,width:m}))]}))},ve=function(e){return void 0===e&&(e=0),e?e+1:0},pe=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,l=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:R(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=S(e))})))})),n.pinned?ve(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(l):"right"===n.pinned?a(l):n.pinned||o(l)},me=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,l=e.setIsWidthDragging,c=e.setMainBodyWidth,d=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;l(!0),n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,f="touches"in n;if(i&&!i.hide){var v=N(i),p=r-o>1,m=p?R(i):[i],g=function(e){var n="right"===i.pinned?h-e:e-h;if(p&&m.length>1)ge({delta:n,header:i,headersRef:a,leafHeaders:m,minWidth:v,setMainBodyWidth:c,setPinnedLeftWidth:d,setPinnedRightWidth:s,startWidth:u});else{var r=Math.max(u+n,v);i.width=r,pe({header:i,headers:a.current,newWidth:r,setMainBodyWidth:c,setPinnedLeftWidth:d,setPinnedRightWidth:s})}a.current.forEach((function(e){E(e)})),t()};if(f){var w=function(e){var n=e.touches[0];g(n.clientX)},C=function(){document.removeEventListener("touchmove",w),document.removeEventListener("touchend",C),l(!1)};document.addEventListener("touchmove",w),document.addEventListener("touchend",C)}else{var y=function(e){g(e.clientX)},b=function(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b),l(!1)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",b)}}},ge=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,l=e.setPinnedLeftWidth,c=e.setPinnedRightWidth,d=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,N(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(d+n,s);pe({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:l,setPinnedRightWidth:c});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},we=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"})}))},Ce={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},ye=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},be=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ie=function(e){return["between","notBetween","in","notIn"].includes(e)},xe=function(e){return["isEmpty","isNotEmpty"].includes(e)},Re=function(n){var t=n.children;return e("div",g({className:"st-filter-container"},{children:t}))},Se=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"})}))},Ee=function(t){var r=t.value,a=t.onChange,c=t.options,d=t.placeholder,s=void 0===d?"Select...":d,u=t.className,h=void 0===u?"":u,f=t.disabled,v=void 0!==f&&f,p=o(!1),m=p[0],w=p[1],C=o(-1),y=C[0],b=C[1],I=i(null),x=c.find((function(e){return e.value===r}));l((function(){var e=function(e){if(m)switch(e.key){case"ArrowDown":e.preventDefault(),b((function(e){return e<c.length-1?e+1:0}));break;case"ArrowUp":e.preventDefault(),b((function(e){return e>0?e-1:c.length-1}));break;case"Enter":e.preventDefault(),y>=0&&(a(c[y].value),w(!1),b(-1));break;case"Escape":e.preventDefault(),w(!1),b(-1)}};if(m)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[m,y,c,a]);return n("div",g({ref:I,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)b(-1);else{var e=c.findIndex((function(e){return e.value===r}));b(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:x?x.label:s})),e(Se,{})]})),e(P,g({open:m,setOpen:w,onClose:function(){w(!1),b(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",g({className:"st-custom-select-options",role:"listbox"},{children:c.map((function(n,t){return e("div",g({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===y?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void b(-1);var e}},{children:n.label}),n.value)}))}))}))]}))},Ne=function(n){var t=n.value,r=n.onChange,o=n.operators.map((function(e){return{value:e,label:Ce[e]}}));return e("div",g({className:"st-filter-section"},{children:e(Ee,{value:t,onChange:function(e){r(e)},options:o})}))},ke=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,d=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===d?"":d).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}))},De=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,c=t.onClearFilter,d=o((null==i?void 0:i.operator)||"contains"),s=d[0],u=d[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=ye("string");l((function(){i?(u(i.operator),v(String(i.value||""))):(u("contains"),v(""))}),[i]);var m=xe(s)||f.trim();return n(Re,{children:[e(Ne,{value:s,onChange:u,operators:p}),be(s)&&e(Me,{children:e(ke,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0})}),e(De,{onApply:function(){var e=g({accessor:r.accessor,operator:s},be(s)&&{value:f});a(e)},onClear:c,canApply:!!m,showClear:!!i})]})},Fe=function(t){var r,i,a=t.header,c=t.currentFilter,d=t.onApplyFilter,s=t.onClearFilter,u=o((null==c?void 0:c.operator)||"equals"),h=u[0],f=u[1],v=o(String((null==c?void 0:c.value)||"")),p=v[0],m=v[1],g=o(String((null===(r=null==c?void 0:c.values)||void 0===r?void 0:r[0])||"")),w=g[0],C=g[1],y=o(String((null===(i=null==c?void 0:c.values)||void 0===i?void 0:i[1])||"")),b=y[0],I=y[1],x=ye("number");l((function(){var e,n;c?(f(c.operator),m(String(c.value||"")),C(String((null===(e=c.values)||void 0===e?void 0:e[0])||"")),I(String((null===(n=c.values)||void 0===n?void 0:n[1])||""))):(f("equals"),m(""),C(""),I(""))}),[c]);return n(Re,{children:[e(Ne,{value:h,onChange:f,operators:x}),be(h)&&e(Me,{children:e(ke,{type:"number",value:p,onChange:m,placeholder:"Enter number...",autoFocus:!0})}),Ie(h)&&n(Me,{children:[e(ke,{type:"number",value:w,onChange:C,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from"}),e(ke,{type:"number",value:b,onChange:I,placeholder:"To..."})]}),e(De,{onApply:function(){var e={accessor:a.accessor,operator:h};be(h)?e.value=parseFloat(p):Ie(h)&&(e.values=[parseFloat(w.toString()),parseFloat(b.toString())]),d(e)},onClear:s,canApply:!!xe(h)||(be(h)?""!==p.trim():!!Ie(h)&&""!==String(w).trim()&&""!==String(b).trim()),showClear:!!c})]})},He=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(Ee,{value:t,onChange:r,options:o,className:a,placeholder:l})},Le=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,c=t.onClearFilter,d=o((null==i?void 0:i.operator)||"equals"),s=d[0],u=d[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=ye("boolean");l((function(){i?(u(i.operator),v(void 0!==i.value?String(i.value):"true")):(u("equals"),v("true"))}),[i]);var m=xe(s)||""!==f;return n(Re,{children:[e(Ne,{value:s,onChange:u,operators:p}),be(s)&&e(Me,{children:e(He,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(De,{onApply:function(){var e={accessor:r.accessor,operator:s};be(s)&&(e.value="true"===f),a(e)},onClear:c,canApply:m,showClear:!!i})]})},Te=function(t){var r,a,c=t.header,d=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,h=o((null==d?void 0:d.operator)||"equals"),f=h[0],v=h[1],p=o((null==d?void 0:d.value)?String(d.value):""),m=p[0],w=p[1],C=o((null===(r=null==d?void 0:d.values)||void 0===r?void 0:r[0])?String(d.values[0]):""),y=C[0],b=C[1],I=o(String((null===(a=null==d?void 0:d.values)||void 0===a?void 0:a[1])||"")),x=I[0],R=I[1],S=ye("date");l((function(){var e,n;d?(v(d.operator),w(String(d.value||"")),b(String((null===(e=d.values)||void 0===e?void 0:e[0])||"")),R(String((null===(n=d.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),b(""),R(""))}),[d]);var E=function(t){var r=t.value,a=t.onChange,c=t.placeholder,d=t.autoFocus,s=t.className,u=o(!1),h=u[0],f=u[1],v=o(""),p=v[0],m=v[1],w=i(null);l((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]),l((function(){d&&w.current&&w.current.focus()}),[d]);var C=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:c,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(s||""),style:{cursor:"pointer"}}),e(P,g({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e(j,{value:C,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return n(Re,{children:[e(Ne,{value:f,onChange:v,operators:S}),be(f)&&e(Me,{children:e(E,{value:m,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ie(f)&&n(Me,{children:[e(E,{value:y,onChange:b,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:x,onChange:R,placeholder:"To date..."})]}),e(De,{onApply:function(){var e={accessor:c.accessor,operator:f};be(f)?e.value=m:Ie(f)&&(e.values=[y,x]),s(e)},onClear:u,canApply:!!xe(f)||(be(f)?""!==m.trim():!!Ie(f)&&""!==y.trim()&&""!==x.trim()),showClear:!!d})]})},Be=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"})}))},Oe=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(Be,{className:"st-checkbox-checkmark"})})),i]}))},Pe=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,d=t.onClearFilter,s=c((function(){return r.enumOptions||[]}),[r.enumOptions]),u=c((function(){return s.map((function(e){return e.value}))}),[s]),h=o((null==i?void 0:i.values)?i.values.map(String):u),f=h[0],v=h[1];l((function(){v(i?i.values?i.values.map(String):[]:u)}),[i,u]);var p=f.length===u.length;return n(Re,{children:[e(Me,{children:n("div",g({className:"st-enum-filter-options"},{children:[e("div",g({className:"st-enum-select-all"},{children:e(Oe,g({checked:p,onChange:function(e){v(e?u:[])}},{children:e("span",g({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),s.map((function(n){return e(Oe,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})):y(y([],n,!0),[e],!1)}));var e}},{children:e("span",g({className:"st-enum-option-label"},{children:n.label}))}),n.value)}))]}))}),e(De,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else d()},onClear:d,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ae=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(Fe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Le,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(Te,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(Pe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(We,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},qe=u((function(t,r){var i,a,c=t.colIndex,d=t.forceHeadersUpdate,s=t.gridColumnEnd,u=t.gridColumnStart,h=t.gridRowEnd,f=t.gridRowStart,v=t.header,p=t.reverse,m=t.sort,w=o(!1),C=w[0],I=w[1],x=W(),R=x.columnReordering,S=x.columnResizing,E=x.draggedHeaderRef,N=x.filters,k=x.forceUpdate,M=x.handleApplyFilter,D=x.handleClearFilter,F=x.headersRef,H=x.hoveredHeaderRef,L=x.onColumnOrderChange,T=x.onSort,B=x.onTableHeaderDragEnd,O=x.rowHeight,A=x.selectColumns,q=x.selectableColumns,z=x.setInitialFocusedCell,U=x.setIsWidthDragging,j=x.setMainBodyWidth,Y=x.setPinnedLeftWidth,X=x.setPinnedRightWidth,K=x.setSelectedCells,V=x.setSelectedColumns,G=x.sortDownIcon,$=x.sortUpIcon,_=Boolean(null==v?void 0:v.isSortable),Q=Boolean(null==v?void 0:v.filterable),Z=N[v.accessor],ne="st-header-cell ".concat(v.accessor===(null===(i=H.current)||void 0===i?void 0:i.accessor)?"st-hovered":""," ").concat((null===(a=E.current)||void 0===a?void 0:a.accessor)===v.accessor?"st-dragging":""," ").concat(_?"clickable":""," ").concat(R&&!_?"columnReordering":""," ").concat(v.children?"parent":""),te=ee({draggedHeaderRef:E,headersRef:F,hoveredHeaderRef:H,onColumnOrderChange:L,onTableHeaderDragEnd:B}),re=te.handleDragStart,oe=te.handleDragEnd,ie=te.handleDragOver,ae=J(),le=function(e){var n=e.event,t=e.header;if(q){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,c);return n.shiftKey&&A?V((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,d,s=y(y([],(a=o,l=n,c=Math.min(a,l),d=Math.max(a,l),Array.from({length:d-c+1},(function(e,n){return c+n}))),!0),r,!0);return new Set(y(y([],Array.from(e),!0),s,!0))})):A&&A(r),K(new Set),void z(null)}t.isSortable&&T(c,t.accessor)};if(l((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 ce=S&&e("div",g({className:"st-header-resize-handle-container",onMouseDown:function(e){var n;ae({callback:me,callbackProps:{event:e.nativeEvent,forceUpdate:k,gridColumnEnd:s,gridColumnStart:u,header:v,headersRef:F,setIsWidthDragging:U,setMainBodyWidth:j,setPinnedLeftWidth:Y,setPinnedRightWidth:X,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;ae({callback:me,callbackProps:{event:e,forceUpdate:k,gridColumnEnd:s,gridColumnStart:u,header:v,headersRef:F,setIsWidthDragging:U,setMainBodyWidth:j,setPinnedLeftWidth:Y,setPinnedRightWidth:X,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"})})),de=m&&m.key.accessor===v.accessor&&n("div",g({className:"st-icon-container",onClick:function(e){return le({event:e,header:v})}},{children:["ascending"===m.direction&&$&&$,"descending"===m.direction&&G&&G]})),se=Q&&n("div",g({className:"st-icon-container",onClick:function(e){e.stopPropagation(),I(!C)}},{children:[e(we,{className:"st-header-icon",style:{fill:Z?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(P,g({open:C,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(Ae,{header:v,currentFilter:Z,onApplyFilter:function(e){M(e),I(!1)},onClearFilter:function(){D(v.accessor),I(!1)}})}))]}));return n("div",g({className:ne,id:b({accessor:v.accessor,rowIndex:0}),onDragOver:function(e){ae({callback:ie,callbackProps:{event:e,hoveredHeader:v},limit:50})},ref:r,style:g(g({gridRowStart:f,gridRowEnd:h,gridColumnStart:u,gridColumnEnd:s},s-u>1?{}:{width:v.width}),h-f>1?{}:{height:O})},{children:[p&&ce,"right"===v.align&&se,"right"===v.align&&de,e("div",g({className:"st-header-label",draggable:R&&!v.disableReorder,onClick:function(e){return le({event:e,header:v})},onDragEnd:function(e){e.preventDefault(),oe(),d()},onDragStart:function(e){R&&v&&function(e){re(e)}(v)}},{children:e("span",g({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:null==v?void 0:v.label}))})),"right"!==v.align&&de,"right"!==v.align&&se,!p&&ce]}))})),ze=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,a=n.headersRef,l=n.hiddenColumns,d=n.maxDepth,s=n.pinned,u=n.sectionRef,h=n.sort,f=v((function(e){return e+1}),0)[1],m=c((function(){var e=[],n=1,t=function(o,i,a){var c,u;if(void 0===a&&(a=!1),!I({hiddenColumns:l,header:o,pinned:s}))return 0;a||n++;var h=null!==(u=null===(c=o.children)||void 0===c?void 0:c.filter((function(e){return I({hiddenColumns:l,header:e,pinned:s})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,p=i,m=h>0?i+1:d+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:p,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach((function(e){I({hiddenColumns:l,header:e,pinned:s})&&(t(e,i+1,g),g=!1)}))}return v-f},o=a.current.filter((function(e){return I({hiddenColumns:l,header:e,pinned:s})})),i=!0;return o.forEach((function(e){t(e,1,i),i=!1})),e}),[a,l,d,s,r]);return e(se,g({condition:!s,wrapper:function(n){return e(de,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"}},{children:e(t,{children:m.map((function(n){return e(qe,{colIndex:n.colIndex,forceHeadersUpdate:f,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,ref:p(),reverse:"right"===s,sort:h},n.header.accessor)}))})}))}))},Ue=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(Ue)):1},je=function(t){var r=t.centerHeaderRef,o=t.headerContainerRef,i=t.headersRef,a=t.hiddenColumns,l=t.mainTemplateColumns,d=t.pinnedLeftColumns,s=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,f=t.sort,v=W(),p=v.pinnedLeftRef,w=v.pinnedRightRef,C=v.setPinnedLeftWidth,y=v.setPinnedRightWidth,b=c((function(){return he({headersRef:i,hiddenColumns:a,pinnedLeftColumns:d,pinnedRightColumns:u})}),[i,a,d,u]),x=c((function(){var e=i.current,n=0;return e.forEach((function(e){if(I({hiddenColumns:a,header:e})){var t=Ue(e);n=Math.max(n,t)}})),{maxDepth:n}}),[i,a]).maxDepth;return m((function(){var e,n;C(ve(null===(e=p.current)||void 0===e?void 0:e.clientWidth)),y(ve(null===(n=w.current)||void 0===n?void 0:n.clientWidth))}),[p,w,C,y]),n("div",g({className:"st-header-container",ref:o},{children:[d.length>0&&e(ze,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,pinned:"left",sectionRef:p,sort:f}),e(ze,{columnIndices:b,gridTemplateColumns:l,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,sectionRef:r,sort:f}),u.length>0&&e(ze,{columnIndices:b,gridTemplateColumns:h,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:x,pinned:"right",sectionRef:w,sort:f})]}))},Ye=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},Xe=function(t){var r=t.flattenedRows,o=t.isWidthDragging,a=t.pinnedLeftWidth,l=t.pinnedRightWidth,d=t.setFlattenedRows,s=t.setScrollTop,u=t.sort,h=t.visibleRows,f=W(),v=f.columnResizing,p=f.editColumns,m=f.headersRef,w=f.hiddenColumns,C=i(null),y=i(null),b=m.current.filter((function(e){return!e.pinned})),I=m.current.filter((function(e){return"left"===e.pinned})),x=m.current.filter((function(e){return"right"===e.pinned})),R=c((function(){return Ye({headers:I,hiddenColumns:w})}),[I,w]),S=c((function(){return Ye({headers:b,hiddenColumns:w})}),[b,w]),E=c((function(){return Ye({headers:x,hiddenColumns:w})}),[x,w]),N={centerHeaderRef:y,headerContainerRef:C,headersRef:m,hiddenColumns:w,mainTemplateColumns:S,pinnedLeftColumns:I,pinnedLeftTemplateColumns:R,pinnedRightColumns:x,pinnedRightTemplateColumns:E,sort:u},k={flattenedRows:r,headerContainerRef:C,isWidthDragging:o,mainTemplateColumns:S,pinnedLeftColumns:I,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:x,pinnedRightTemplateColumns:E,pinnedRightWidth:l,setFlattenedRows:d,setScrollTop:s,visibleRows:h};return n("div",g({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:p?"calc(100% - 27.5px)":"100%"}},{children:[e(je,g({},N)),e(fe,g({},k))]}))},Ke=function(t){var r,a,c=t.mainBodyWidth,d=t.mainBodyRef,s=t.pinnedLeftWidth,u=t.pinnedRightWidth,h=t.setMainBodyWidth,f=t.tableBodyContainerRef,v=W().editColumns,p=o(!1),m=p[0],w=p[1],C=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=v?28:0,I=(v?u+1:u)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return l((function(){setTimeout((function(){!function(){var e;if(d.current){var n=null===(e=d.current)||void 0===e?void 0:e.scrollWidth;h(n||0)}}()}),1)}),[d,h]),l((function(){setTimeout((function(){!function(){if(d.current){var e=d.current.clientWidth;w(c>e)}}()}),1)}),[d,c,h]),m?n("div",g({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(r=C.current)||void 0===r?void 0:r.offsetHeight}}),c>0&&e(de,g({childRef:C},{children:e("div",g({className:"st-horizontal-scrollbar-middle",ref:C,style:{flexGrow:1}},{children:e("div",{style:{width:c,height:".3px"}})}))})),u>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:I,height:null===(a=C.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},Ve={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 Ve.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?Ve.string(e,n,t):"number"==typeof e&&"number"==typeof n?Ve.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Ve.boolean(e,n,t):Ve.string(String(e),String(n),t)}},Ge=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 Ve.number(i,a,r)}return"date"===t?Ve.date(String(e),String(n),r):"boolean"===t?Ve.boolean(Boolean(e),Boolean(n),r):"enum"===t?Ve.enum(String(e),String(n),r):Ve.string(String(e),String(n),r)},Je=function(e,n,t){var r,o=(null===(r=n.key)||void 0===r?void 0:r.type)||"string",i=n.direction,a=new Map,l=new Map,c="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(a.size)).toString();c=r,l.set(c,e),a.has(c)||a.set(c,[])}else if(c){var o=a.get(c)||[];o.push(e),a.set(c,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(t=a.get(i))||void 0===t||t.push(e)}}));var d=[];return a.forEach((function(e,r){if(l.has(r)){var a=l.get(r);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=$e(a.rowMeta.children,n,t)),d.push(a)}var c=y([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],l=t.rowData[r];return Ge(a,l,o,i)}));d.push.apply(d,c.map((function(e){var r=g({},e);if(r.rowMeta.children&&r.rowMeta.children.length>0){var o=$e(r.rowMeta.children,n,t);r.rowMeta=g(g({},r.rowMeta),{children:o})}return r})))})),d},$e=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 y([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,a=e.rowData[r],l=t.rowData[r];return Ge(a,l,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:$e(e.rowMeta.children,n,t)})}):e}))},_e=function(e){var n=e.headers,t=e.tableRows,r=o(null),i=r[0],a=r[1],l=c((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),d=o(l),s=d[0],u=d[1],h=c((function(){if(!i)return t;var e=function(e,n,t){return{sortedData:Je(n,t,e),newSortConfig:t}}(n,t,i).sortedData;return e}),[t,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,t){var r=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===t)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(n);o&&a((function(e){return e&&e.key.accessor===t?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Qe=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var l=a.children.some((function(e){return e.accessor===n})),c=!1;if(!l)for(var d=0,s=a.children;d<s.length;d++){var u=s[d];if(Qe([u],n,t,r),!1===t[u.accessor]){c=!0;break}}(l||c)&&(t[a.accessor]=!1)}}},Ze=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},en=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(en(e.children,n),Ze(e.children,n)&&(n[e.accessor]=!0))}))},nn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.header,d=r.hiddenColumns,s=r.setHiddenColumns,u=o(!0),h=u[0],f=u[1],v=W(),p=v.expandIcon,m=v.collapseIcon,w=v.headersRef,C=v.setMainBodyWidth,y=v.setPinnedLeftWidth,b=v.setPinnedRightWidth,I="".concat(16*l,"px"),x=c.children&&c.children.length>0,E=d[c.accessor]||x&&c.children&&Ze(c.children,d);return n(t,{children:[n("div",g({className:"st-header-checkbox-item",style:{paddingLeft:I}},{children:[e("div",g({className:"st-header-icon-container"},{children:x?e("div",g({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?m:p})):null})),e(Oe,g({checked:E,onChange:function(e){var n=g({},d);(n[c.accessor]=e,e)?en(i,n):(Qe(i,c.accessor,n),x&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===d[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,Qe(i,c.children[0].accessor,n)));s(n),w.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,l=0;n.forEach((function(e){if(!e.hide){var n=R(e).reduce((function(e,n){return e+S(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:l+=n}}));var c=ve(i),d=ve(a);r(c),o(d),t(l)}({headers:w.current,setMainBodyWidth:C,setPinnedLeftWidth:y,setPinnedRightWidth:b})}},{children:c.label}))]})),x&&h&&c.children&&e("div",g({className:"st-nested-headers"},{children:c.children.map((function(n,t){return e(nn,{allHeaders:i,depth:l+1,header:n,hiddenColumns:d,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},tn=function(n){var t=n.headers,r=n.open,o=n.position,i=n.setHiddenColumns,a=n.hiddenColumns,l="left"===o?"left":"";return e("div",g({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(l),onClick:function(e){return e.stopPropagation()}},{children:e("div",g({className:"st-column-editor-popout-content"},{children:t.map((function(n,r){return e(nn,{header:n,hiddenColumns:a,setHiddenColumns:i,allHeaders:t},"".concat(n.accessor,"-").concat(r))}))}))}))},rn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.hiddenColumns,d=t.position,s=void 0===d?"right":d,u=t.setHiddenColumns,h=o(a),f=h[0],v=h[1];return i?n("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e("div",g({className:"st-column-editor-text"},{children:r})),e(tn,{headers:l,open:f,position:s,setHiddenColumns:u,hiddenColumns:c})]})):null},on=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"})}))},an=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"})}))},ln=function(n){var t=n.children,o=i({}),l=a((function(e,n){return!!o.current[n]&&o.current[n].find((function(n){return n===e}))}),[]),c=a((function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)}),[]),d=a((function(e){e.onscroll=null}),[]),s=a((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&&(d(n),c(e,n),window.requestAnimationFrame((function(){var e=Object.keys(o.current).filter((function(e){return o.current[e].includes(n)}));s(n,e)})))}))}))}))}}),[d,c]),u=a((function(e,n){n.forEach((function(n){o.current[n]||(o.current[n]=[]),l(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))})),s(e,n)}),[l,c,s]),h=a((function(e,n){n.forEach((function(n){if(l(e,n)){d(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}}))}),[l,d]);return e(le.Provider,g({value:{registerPane:u,unregisterPane:h}},{children:r.Children.only(t)}))},cn=function(e,n){var t=n.find((function(n){return n.accessor===e.accessor})),r=(null==t?void 0:t.label)||e.accessor,o=Ce[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=W(),r=t.filters,o=t.handleClearFilter,i=t.headersRef,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:cn(t,i.current)})),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)}))}))}))}))},sn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},un=function(e){var n=e.rows,t=o({}),r=t[0],i=t[1],l=c((function(){return 0===Object.keys(r).length?n:n.filter((function(e){return Object.values(r).every((function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var d=o.map(Number),s=d[0],u=d[1];return l>=s&&l<=u}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return s=h[0],u=h[1],l<s||l>u}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=new Date(e),v=new Date(String(r||"")),p=sn(f),m=sn(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 sn(new Date(String(e||"")))})),w=g[0],C=g[1];return p>=w&&p<=C}return!1;case"notBetween":if(o&&2===o.length){var y=o.map((function(e){return sn(new Date(String(e||"")))}));return w=y[0],C=y[1],p<w||p>C}return!0}}if("boolean"==typeof e){var b=Boolean(r);if("equals"===t)return e===b}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),S=r?String(r).toLowerCase():"";switch(t){case"equals":return R===S;case"notEquals":return R!==S;default:return!0}}(e.rowData[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}}))}))}),[n,r]),d=a((function(e){i((function(n){var t;return g(g({},n),((t={})[e.accessor]=e,t))}))}),[]),s=a((function(e){i((function(n){var t=g({},n);return delete t[e],t}))}),[]),u=a((function(){i({})}),[]);return{filters:r,filteredRows:l,handleApplyFilter:d,handleClearFilter:s,handleClearAllFilters:u}},hn=function(n){var t=o(!1),r=t[0],i=t[1];return l((function(){i(!0)}),[]),r?e(fn,g({},n)):null},fn=function(t){var r=t.allowAnimations,d=void 0!==r&&r,s=t.cellUpdateFlash,u=void 0!==s&&s,h=t.collapseIcon,f=void 0===h?e(T,{className:"st-expand-icon"}):h,p=t.columnEditorPosition,w=void 0===p?"right":p,C=t.columnEditorText,y=void 0===C?"Columns":C,b=t.columnReordering,I=void 0!==b&&b,S=t.columnResizing,E=void 0!==S&&S,N=t.defaultHeaders,M=t.editColumns,W=void 0!==M&&M,B=t.editColumnsInitOpen,O=void 0!==B&&B,P=t.expandIcon,A=void 0===P?e(L,{className:"st-expand-icon"}):P,q=t.height,z=t.hideFooter,U=void 0!==z&&z,j=t.nextIcon,Y=void 0===j?e(L,{className:"st-next-prev-icon"}):j,X=t.onCellEdit,K=t.onColumnOrderChange,V=t.onGridReady,G=t.onNextPage,J=t.prevIcon,$=void 0===J?e(H,{className:"st-next-prev-icon"}):J,_=t.rowHeight,Q=void 0===_?40:_,Z=t.rows,ee=t.rowsPerPage,ne=void 0===ee?10:ee,te=t.selectableCells,re=void 0!==te&&te,oe=t.selectableColumns,ie=void 0!==oe&&oe,ae=t.shouldPaginate,le=void 0!==ae&&ae,ce=t.sortDownIcon,de=void 0===ce?e(on,{className:"st-header-icon"}):ce,se=t.sortUpIcon,ue=void 0===se?e(an,{className:"st-header-icon"}):se,he=t.tableRef,fe=t.theme,ve=void 0===fe?"light":fe,pe=t.useHoverRowBackground,me=void 0===pe||pe,ge=t.useOddEvenRowBackground,we=void 0===ge||ge,Ce=t.useOddColumnBackground,ye=void 0!==Ce&&Ce;ye&&(we=!1);var be=i(null),Ie=i(N),xe=i(null),Re=i(null),Se=i(null),Ee=i(null),Ne=i(null),ke=o(1),Me=ke[0],De=ke[1],We=o(!1),Fe=We[0],He=We[1],Le=o(0),Te=Le[0],Be=Le[1],Oe=o(0),Pe=Oe[0],Ae=Oe[1],qe=o(0),ze=qe[0],Ue=qe[1],je=o(0),Ye=je[0],Ve=je[1],Ge=o(0),Je=Ge[0],$e=Ge[1],Qe=un({rows:Z}),Ze=Qe.filters,en=Qe.filteredRows,nn=Qe.handleApplyFilter,tn=Qe.handleClearFilter,cn=Qe.handleClearAllFilters,sn=_e({headers:Ie.current,tableRows:en}),hn=sn.sort,fn=sn.sortedRows,vn=sn.hiddenColumns,pn=sn.setHiddenColumns,mn=sn.updateSort;l((function(){null==V||V()}),[V]);var gn=c((function(){if(!le)return fn;var e=(Me-1)*ne,n=e+ne;return fn.slice(e,n)}),[Me,ne,le,fn]),wn=o(gn),Cn=wn[0],yn=wn[1];l((function(){yn(gn)}),[gn]);var bn=function(e){var n=e.height,t=e.rowHeight;return c((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:q,rowHeight:Q}),In=c((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,l=[],c=0,d=Math.max(0,i-a*n),s=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=c*a;if(h>=s)break;h+a>d&&l.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),l}({bufferRowCount:5,contentHeight:bn,flattenedRows:Cn,rowHeight:Q,scrollTop:Ye})}),[bn,Q,Cn,Ye]),xn=v((function(e){return e+1}),0)[1],Rn=function(e){var n=e.selectableCells,t=e.headers,r=e.visibleRows,d=o(new Set),s=d[0],u=d[1],h=o(new Set),f=h[0],v=h[1],p=o(null),m=p[0],g=p[1],w=o(null),C=w[0],y=w[1],b=i(!1),I=i(null),x=a((function(){var e=t.flatMap(R).filter((function(e){return!e.hide})),n=new Map;e.forEach((function(e,t){n.set(t,e.accessor)}));var o=Array.from(s).reduce((function(e,t){var o=t.split("-").map(Number),i=o[0],a=o[1];e[i]||(e[i]=[]);var l=n.get(a);return e[i][a]=l?r[i].row.rowData[l]:"",e}),{}),i=Object.values(o).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(i)}),[t,s,r]),S=a((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 d=a;d<=l;d++)if(c>=0&&c<r.length){var s=r[c].row.rowMeta.rowId;t.add(k({colIndex:d,rowIndex:c,rowId:s}))}v(new Set),g(null),u(t)}),[r,v,g,u]),E=a((function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<t.length){var n=k(e);v(new Set),g(null),u(new Set([n])),y(e)}}),[t.length,r.length,v,g,u,y]),N=a((function(e,n){void 0===n&&(n=!1),u(new Set),y(null),v((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&g(e[e.length-1])}),[u,y,v,g]);l((function(){var e=function(e){if(n&&C){var o=C.rowIndex,i=C.colIndex,a=C.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(r[o].row.rowMeta.rowId!==a){var l=r.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c={rowIndex:o-1,colIndex:i,rowId:r[o-1].row.rowMeta.rowId};E(c)}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c={rowIndex:o+1,colIndex:i,rowId:r[o+1].row.rowMeta.rowId},E(c))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c={rowIndex:o,colIndex:i-1,rowId:r[o].row.rowMeta.rowId},E(c))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<t.length-1&&(c={rowIndex:o,colIndex:i+1,rowId:r[o].row.rowMeta.rowId},E(c))):"Escape"===e.key&&(u(new Set),v(new Set),g(null),I.current=null,y(null))}else x()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[x,t.length,C,S,E,n,r]);var M=a((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=a((function(e){var n,t,o,i,a,l,c=e.colIndex,d=e.rowIndex,s=e.rowId,u=[],h=null===(o=null===(t=null===(n=r[d-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===o?void 0:o.rowId,v={colIndex:c,rowIndex:d+1,rowId:null===(l=null===(a=null===(i=r[d+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===l?void 0:l.rowId},p={colIndex:c-1,rowIndex:d,rowId:s},m={colIndex:c+1,rowIndex:d,rowId:s};return(!M({colIndex:c,rowIndex:d-1,rowId:h})||f.has(c)&&0===d)&&u.push("st-selected-top-border"),(!M(v)||f.has(c)&&d===r.length-1)&&u.push("st-selected-bottom-border"),M(p)||u.push("st-selected-left-border"),M(m)||u.push("st-selected-right-border"),u.join(" ")}),[M,r,f]),W=c((function(){return C?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===C.rowIndex&&t===C.colIndex&&r===C.rowId}:function(){return!1}}),[C]);return{getBorderClass:D,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;if(n){b.current=!0,I.current={rowIndex:r,colIndex:t,rowId:o},v(new Set),g(null);var i=k({colIndex:t,rowIndex:r,rowId:o});u(new Set([i])),y({rowIndex:r,colIndex:t,rowId:o})}},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&b.current&&I.current){for(var i=new Set,a=Math.min(I.current.rowIndex,o),l=Math.max(I.current.rowIndex,o),c=Math.min(I.current.colIndex,t),d=Math.max(I.current.colIndex,t),s=a;s<=l;s++)for(var h=c;h<=d;h++)if(s>=0&&s<r.length){var f=r[s].row.rowMeta.rowId;i.add(k({colIndex:h,rowIndex:s,rowId:f}))}u(i)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:W,isSelected:M,lastSelectedColumnIndex:m,selectColumns:N,selectedCells:s,selectedColumns:f,setInitialFocusedCell:y,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:re,headers:Ie.current,visibleRows:In}),Sn=Rn.getBorderClass,En=Rn.handleMouseDown,Nn=Rn.handleMouseOver,kn=Rn.handleMouseUp,Mn=Rn.isInitialFocusedCell,Dn=Rn.isSelected,Wn=Rn.selectColumns,Fn=Rn.selectedCells,Hn=Rn.selectedColumns,Ln=Rn.setInitialFocusedCell,Tn=Rn.setSelectedCells,Bn=Rn.setSelectedColumns,On=a((function(e,n){mn(e,n)}),[mn]),Pn=a((function(e){Ie.current=e,xn()}),[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns;l((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:ie,selectedCells:Fn,selectedColumns:Hn,setSelectedCells:Tn,setSelectedColumns:Bn}),m((function(){if(Ne.current){var e=Ne.current.offsetWidth-Ne.current.clientWidth;$e(e)}}),[]),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;m((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:xn,tableBodyContainerRef:Ne,setScrollbarWidth:$e});var An=i(new Map);return l((function(){he&&(he.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,l=e.newValue,c=null===(t=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==c){var d=x({rowId:c,accessor:i}),s=An.current.get(d);s&&s.updateContent(l),void 0!==(null===(o=null===(r=null==Z?void 0:Z[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=l)}}})}),[he,Z]),e(D,g({value:{allowAnimations:d,cellRegistry:An.current,cellUpdateFlash:u,collapseIcon:f,columnReordering:I,columnResizing:E,draggedHeaderRef:be,editColumns:W,expandIcon:A,filters:Ze,forceUpdate:xn,getBorderClass:Sn,handleApplyFilter:nn,handleClearFilter:tn,handleClearAllFilters:cn,handleMouseDown:En,handleMouseOver:Nn,headersRef:Ie,hiddenColumns:vn,hoveredHeaderRef:xe,isInitialFocusedCell:Mn,isSelected:Dn,mainBodyRef:Re,nextIcon:Y,onCellEdit:X,onColumnOrderChange:K,onSort:On,onTableHeaderDragEnd:Pn,pinnedLeftRef:Se,pinnedRightRef:Ee,prevIcon:$,rowHeight:Q,scrollbarWidth:Je,selectColumns:Wn,selectableColumns:ie,setInitialFocusedCell:Ln,setIsWidthDragging:He,setMainBodyWidth:Be,setPinnedLeftWidth:Ae,setPinnedRightWidth:Ue,setSelectedCells:Tn,setSelectedColumns:Bn,shouldPaginate:le,sortDownIcon:de,sortUpIcon:ue,tableBodyContainerRef:Ne,theme:ve,useHoverRowBackground:me,useOddColumnBackground:ye,useOddEvenRowBackground:we}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(ve),style:q?{height:q}:{}},{children:e(ln,{children:n("div",g({className:"st-wrapper-container"},{children:[e(dn,{}),n("div",g({className:"st-content-wrapper",onMouseUp:kn,onMouseLeave:kn},{children:[e(Xe,{flattenedRows:Cn,isWidthDragging:Fe,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setFlattenedRows:yn,setScrollTop:Ve,sort:hn,visibleRows:In}),e(rn,{columnEditorText:y,editColumns:W,editColumnsInitOpen:O,headers:Ie.current,hiddenColumns:vn,position:w,setHiddenColumns:pn})]})),e(Ke,{mainBodyRef:Re,mainBodyWidth:Te,pinnedLeftWidth:Pe,pinnedRightWidth:ze,setMainBodyWidth:Be,tableBodyContainerRef:Ne}),e(F,{currentPage:Me,hideFooter:U,onPageChange:De,onNextPage:G,shouldPaginate:le,totalPages:Math.ceil(en.length/ne)})]}))})}))}))};export{hn as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map