simple-table-core 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as f,cloneElement as h,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var w=function(){return w=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},w.apply(this,arguments)};function m(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},I=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},S=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},x=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return x(e)}):[e]},R=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(C({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){R(e)})},E=function(e){return"number"==typeof e.minWidth?e.minWidth:40},N=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},k=function(e){return e.row[e.rowIdAccessor]},A=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=k({row:t,rowIdAccessor:c}),f=l[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return N(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},F=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},H=s(void 0),D=function(n){var t=n.children,r=n.value;return e(H.Provider,w({value:r},{children:t}))},T=function(){var e=u(H);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},M=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=T(),d=u.nextIcon,f=u.prevIcon,h=o(!0),v=h[0],p=h[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",w({className:"st-footer"},{children:[e("button",w({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:f})),e("button",w({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",w({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",w({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},B=function(n){var t=n.className;return e("svg",w({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",w({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"})}))},W=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},O=function(e){return e.position*(e.rowHeight+1)-1},P=function(e){return e.position*(e.rowHeight+1)},q=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,f=n.containerRef,h=n.positioning,v=void 0===h?"fixed":h,p=T().mainBodyRef,g=i(null),m=i(null),y=o("bottom-left"),b=y[0],C=y[1],I=o({}),S=I[0],x=I[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!m.current&&g.current.parentElement&&(m.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&m.current){var e,n=g.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,f,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",w({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:w(w({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},S),{overflow:s})},{children:t})):null},z=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",w({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},Y=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],f=function(e){d(e),i(e),l(!1),r()};return n(q,w({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(z,w({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(z,w({isSelected:!1===u,onClick:function(){return f(!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)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},G=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},K=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=T(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],p=h[1],g=o("days"),m=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",w({className:"st-datepicker"},{children:[n("div",w({className:"st-datepicker-header"},{children:["days"===m&&n(t,{children:[e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",w({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===m&&e("div",w({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===m&&e("div",w({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",w({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",w({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var f=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e("div",w({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)))},h=1;h<=o;h++)f(h);var g=35-(i+o),m=function(t){n.push(e("div",w({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(h=1;h<=g;h++)m(h);return n}(),"months"===m&&(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",w({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===m&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",w({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",w({className:"st-datepicker-footer"},{children:e("button",w({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},U=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},V=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(q,w({open:o,onClose:l,setOpen:i,width:280},{children:e(K,{value:U(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},J=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(q,w({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",w({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(z,w({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},X=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(Y,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(V,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(J,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(G,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(j,{defaultValue:u,onBlur:s,onChange:o})},_=0,$=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===_||o-_>=r)&&(_=o,n(t))}},Q=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},Z=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(Z);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Z(e[t]));return n},ee=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ne=Date.now(),te={screenX:0,screenY:0},re=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=re(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},oe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ie(e,n,t){var r,o,i=Z(e),a=!1;try{var l=oe(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=w({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),f=s;i.splice(f,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var ae=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=T().setHeaders,l=Q(t);return{handleDragStart:function(e){n.current=e,ne=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-te.screenX,2)+Math.pow(u-te.screenY,2));r.current=a;var f,h=n.current,v=!1;if(oe(h)!==oe(a)){f=(I=ie(t,h,a)).newHeaders,v=I.emergencyBreak}else{var p=t,g=re(p,h.accessor),w=re(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var I=function(e,n,t){var r=Z(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=I.newHeaders,v=I.emergencyBreak}if(!(c||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-ne<1500||d<40)||(ne=S,te={screenX:s,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},le=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ce={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},se={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ue={duration:150,easing:"ease-out",delay:0},de=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},fe=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){de(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},he=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return m(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:le()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),le()?w(w({},ue),e):w(w({},"column"===n?ce:se),e)}(t,i?"column":"row"),de(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,fe(n,a,t)]);case 1:return l.sent(),[2]}})})},ve=function(e){var n=e.element,t=e.options;return m(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,f,h,v,p,g,w;return y(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,f=t.respectReducedMotion,h=void 0===f||f,le()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},pe=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=T(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),p=i(null),g=Q(f),m=Q(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=w(w({},se),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,I=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==I){var S=5*h,x=b-S,R=b+C+S,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,k=i.y<b,A=i.y>b+C,F=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,H=.6*h,D=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&A){var T=b+C+D(i.y,b,b+C)+F%15*H*2.5+F%7*(.4*h);return void ve({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&k){T=b-D(i.y,b,b+C)-F%15*H*2.5-F%7*(.4*h);return void ve({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+D(l.y,b,b+C)+F%10*H*1;return void ve({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){M=b-D(l.y,b,b+C)-F%10*H*1;return void ve({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}he({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,f,o,g,m,h,null==a?void 0:a.position,a]),e("div",w({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};pe.displayName="Animate";var ge=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:w({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"})}))},we=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",w({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",w({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(ge,{className:"st-checkbox-checkmark"})})),i]}))},me=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ye=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,f=t.isInitialFocused,h=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=T(),m=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,I=g.draggedHeaderRef,x=g.enableRowSelection,R=g.expandIcon,E=g.handleMouseDown,A=g.handleMouseOver,F=g.handleRowSelect,H=g.headers,D=g.hoveredHeaderRef,M=g.isCopyFlashing,B=g.isRowSelected,L=g.isWarningFlashing,W=g.onCellEdit,O=g.onCellClick,P=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,Y=g.rowIdAccessor,j=g.rowsWithSelectedCells,G=g.selectedColumns,K=g.setUnexpandedRows,U=g.tableBodyContainerRef,V=g.theme,J=g.unexpandedRows,_=g.useOddColumnBackground,Q=p.depth,Z=p.row,ee=o(Z[u.accessor]),ne=ee[0],te=ee[1],re=o(!1),oe=re[0],ie=re[1],le=o(!1),ce=le[0],se=le[1],ue=o(!1),de=ue[0],fe=ue[1],he=i(null),ve=k({row:Z,rowIdAccessor:Y}),ge=z&&z[Q],ye=!!ge&&function(e,n){if(!n)return!1;var t=e[n];return N(t)}(Z,ge),be=!J.has(String(ve)),Ce=M({rowIndex:v,colIndex:s,rowId:ve}),Ie=L({rowIndex:v,colIndex:s,rowId:ve}),Se=a(function(){var e,n,t;if(!b)return!1;var r=H.filter(function(e){return"left"===e.pinned}),o=H.filter(function(e){return!e.pinned}),i=H.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,H,u.accessor,u.pinned]),xe=ae({draggedHeaderRef:I,headers:H,hoveredHeaderRef:D,onTableHeaderDragEnd:P}).handleDragOver,Re=$(),Ee=C({accessor:u.accessor,rowId:ve}),Ne=S({rowId:ve,accessor:u.accessor}),ke=u.isSelectionColumn&&x;c(function(){if(m){var e="".concat(ve,"-").concat(u.accessor);return m.set(e,{updateContent:function(e){ne!==e?(te(e),y&&(se(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){se(!1)},800))):te(e)}}),function(){m.delete(e),he.current&&clearTimeout(he.current)}}},[m,y,ve,u.accessor,ne]),c(function(){if(ce){var e=setTimeout(function(){se(!1)},850);return function(){return clearTimeout(e)}}},[ce]),c(function(){te(Z[u.accessor])},[Z,u.accessor]);var Ae="boolean"===u.type||"date"===u.type||"enum"===u.type,Fe=Boolean(null==u?void 0:u.isEditable),He=G.has(s),De=d&&!He,Te=a(function(){return!!ke&&j.has(String(ve))},[ke,j,ve]),Me="st-cell ".concat(Q>0&&u.expandable?"st-cell-depth-".concat(Q):""," ").concat(De?f?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(He?f?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Fe?"clickable":""," ").concat(ce?f?"st-cell-updating-first":"st-cell-updating":""," ").concat(Ce?f?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Ie?f?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(_?h%2==0?"even-column":"odd-column":""," ").concat(ke?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(Se?"st-last-column":""),Be=l(function(e){te(e),Z[u.accessor]=e,null==W||W({accessor:u.accessor,newValue:e,row:Z,rowIndex:v})},[u.accessor,W,Z,v]),Le=l(function(){K(function(e){var n=new Set(e),t=String(ve);return n.has(t)?n.delete(t):n.add(t),n})},[ve,K]);return!oe||Ae||ke?n(pe,w({className:Me,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":ve,"data-row-index":v,id:Ee,onClick:function(){O&&!ke&&O({accessor:u.accessor,colIndex:s,row:Z,rowId:ve,rowIndex:v,value:ne})},onDoubleClick:function(){return u.isEditable&&!ke&&ie(!0)},onDragOver:function(e){ke||Re({callback:xe,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){oe||ke||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||oe||(e.preventDefault(),ie(!0))},onMouseDown:function(){oe||ke||E({rowIndex:v,colIndex:s,rowId:ve})},onMouseEnter:function(){fe(!0)},onMouseLeave:function(){fe(!1)},onMouseOver:function(){oe||ke||A({rowIndex:v,colIndex:s,rowId:ve})},parentRef:U,tableRow:p},{children:[u.expandable&&ye?e("div",w({className:"st-icon-container st-expand-icon-container ".concat(be?"expanded":"collapsed"),onClick:Le},{children:R})):null,e("span",w({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:ke?n("div",w({className:"st-selection-cell-content"},{children:[e("div",w({className:"st-selection-control"},{children:de||B&&B(String(ve))?e(we,{checked:!!B&&B(String(ve)),onChange:function(e){F&&F(String(ve),e)}}):e("span",w({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!ke||0===q.length)return null;if(!(de||B&&B(String(ve))))return null;var n={row:Z};return e("div",w({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",w({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:Z,theme:V}):me({content:ne,header:u})})})),oe&&Ae&&!ke&&e(X,{enumOptions:u.enumOptions,onChange:Be,setIsEditing:ie,type:u.type,value:ne})]}),Ne):e("div",w({className:"st-cell-editing",id:C({accessor:u.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(X,{enumOptions:u.enumOptions,onChange:Be,setIsEditing:ie,type:u.type,value:ne})}))},be=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=T().rowIdAccessor,d=i.filter(function(e){return I({header:e,pinned:a})});return e(t,{children:d.map(function(n,t){var d=k({row:s.row,rowIdAccessor:u}),f=C({accessor:n.accessor,rowId:d});return e(Ce,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},Ce=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=T(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=k({row:s.row,rowIdAccessor:g});if(r.children){var m=r.children.filter(function(e){return I({header:e,pinned:a})});return e(f,{children:m.map(function(n){var r=C({accessor:n.accessor,rowId:w});return e(Ce,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var y={rowIndex:l,colIndex:u,rowId:w},b=h(y),S=v(y),x=p(y),R=C({accessor:r.accessor,rowId:w});return e(ye,{borderClass:b,colIndex:u,header:r,isHighlighted:S,isInitialFocused:x,nestedIndex:i,rowIndex:l,tableRow:s},R)},Ie=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hoveredIndex,l=n.index,c=n.pinned,s=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=T(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,m=h.isRowSelected,y=h.useOddEvenRowBackground,b=f.position,C=b%2==0,I=k({row:f.row,rowIdAccessor:p}),S=!!m&&m(String(I));return e("div",w({className:"st-row ".concat(y?C?"even":"odd":""," ").concat(a===l&&v?"hovered":""," ").concat(S?"selected":""),onMouseEnter:function(){g||d(l)},style:{gridTemplateColumns:o,top:P({position:b,rowHeight:s}),height:"".concat(s,"px")}},{children:e(be,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:b,rowIndices:u,tableRow:f},I)}))},Se=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",w({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:O({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},xe=s(void 0),Re=["default"],Ee=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(xe);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,Re),function(){n.current&&i(n.current,Re)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},Ne=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},ke=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.hoveredIndex,u=t.pinned,d=t.rowHeight,h=t.rowIndices,v=t.setHoveredIndex,g=t.templateColumns,m=t.totalHeight,y=t.rowsToRender,b=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main",I=T().rowIdAccessor,S=i(null);return p(r,function(){return S.current},[]),a(function(){return ee(c,u)},[c,u])?e(Ne,w({condition:!u,wrapper:function(n){return e(Ee,w({childRef:S},{children:n}))}},{children:e("div",w({className:C,ref:S,style:w({position:"relative",height:"".concat(m,"px"),width:b},!u&&{flexGrow:1})},{children:y.map(function(t,r){var i=k({row:t.row,rowIdAccessor:I});return n(f,{children:[0!==r&&e(Se,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:d,templateColumns:g,rowIndex:r-1}),e(Ie,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:g,headers:c,hoveredIndex:s,index:r,pinned:u,rowHeight:d,rowIndices:h,setHoveredIndex:v,tableRow:t},i)]},i)})}))})):null});function Ae(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return I({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&I({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}ke.displayName="TableSection";var Fe=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,f=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,m=t.tableRows,y=T(),b=y.headerContainerRef,C=y.headers,I=y.isAnimating,S=y.mainBodyRef,x=y.onLoadMore,R=y.rowHeight,E=y.rowIdAccessor,N=y.scrollbarWidth,A=y.setIsScrolling,F=y.shouldPaginate,H=y.tableBodyContainerRef,D=o(null),M=D[0],B=D[1],L=o(!1),W=L[0],O=L[1];c(function(){I&&null!==M&&B(null)},[I,M]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:b,mainSectionRef:H,scrollbarWidth:N}),c(function(){return function(){q.current&&clearTimeout(q.current)}},[]);var P=i(null),q=i(null),z=i(0),Y=function(e){return e.length}(m),j=Y*(R+1)-1,G=a(function(){return Ae({headers:C,pinnedLeftColumns:s,pinnedRightColumns:f})},[C,s,f]),K=a(function(){var e={};return p.forEach(function(n,t){var r=String(k({row:n.row,rowIdAccessor:E}));e[r]=t}),e},[p,E]),U=l(function(e,n){if(x&&!F&&!W){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(O(!0),x(),setTimeout(function(){O(!1)},1e3))}},[x,F,W]),V={columnIndices:G,headerContainerRef:b,headers:C,hoveredIndex:M,rowHeight:R,rowIndices:K,rowsToRender:p,setHoveredIndex:B};return n("div",w({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;A(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){A(!1)},150),P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){g(t),U(n,t),z.current=t})},ref:H},{children:[e(ke,w({},V,{pinned:"left",templateColumns:u,totalHeight:j,width:d})),e(ke,w({},V,{columnIndexStart:s.length,ref:S,templateColumns:r,totalHeight:j})),e(ke,w({},V,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:j,width:v}))]}))},He=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},De=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,De(e.children)),n})},Te=function(e){return void 0===e&&(e=0),e?e+1:0},Me=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var s="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(o&&!o.hide){l(!0);var d=E(o),f=t-r>1,h=f?x(o):[o],v=function(e){var n="right"===o.pinned?s-e:e-s;if(f&&h.length>1)Be({delta:n,leafHeaders:h,minWidth:d,startWidth:c});else{var t=Math.max(c+n,d);o.width=t}i.forEach(function(e){R(e)});var r=b([],i,!0);a(r)};if(u){var p=function(e){var n=e.touches[0];v(n.clientX)},g=function(){document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g),l(!1)};document.addEventListener("touchmove",p),document.addEventListener("touchend",g)}else{var w=function(e){v(e.clientX)},m=function(){document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",m),l(!1)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",m)}}},Be=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,E(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/a),o=Math.max(n+t,r);e.width=o})},Le=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=x(e).reduce(function(e,n){return e+function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(C({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:Te(t),rightWidth:Te(r),mainWidth:o}},We=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:w({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"})}))},Oe={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"},Pe=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},qe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},ze=function(e){return["between","notBetween","in","notIn"].includes(e)},Ye=function(e){return["isEmpty","isNotEmpty"].includes(e)},je=function(n){var t=n.children;return e("div",w({className:"st-filter-container"},{children:t}))},Ge=function(){return e("svg",w({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,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,f=void 0===d?"":d,h=t.disabled,v=void 0!==h&&h,p=o(!1),g=p[0],m=p[1],y=o(-1),b=y[0],C=y[1],I=i(null),S=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),m(!1),C(-1));break;case"Escape":e.preventDefault(),m(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",w({ref:I,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",w({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(m(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",w({className:"st-custom-select-value"},{children:S?S.label:u})),e(Ge,{})]})),e(q,w({open:g,setOpen:m,onClose:function(){m(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",w({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",w({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),m(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},Ue=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Oe[e]}});return e("div",w({className:"st-filter-section"},{children:e(Ke,{value:t,onChange:function(e){r(e)},options:o})}))},Ve=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},Je=function(n){var t=n.children,r=n.className;return e("div",w({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Xe=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",w({className:"st-filter-actions"},{children:[e("button",w({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",w({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},_e=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],f=o(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=Pe("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=w({accessor:r.accessor,operator:u},qe(u)&&{value:h});a(e)},m=Ye(u)||h.trim();return n(je,{children:[e(Ue,{value:u,onChange:d,operators:p}),qe(u)&&e(Je,{children:e(Ve,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Xe,{onApply:g,onClear:l,canApply:!!m,showClear:!!i})]})},$e=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),f=d[0],h=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],I=b[1],S=Pe("number");c(function(){var e,n;l?(h(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),I(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(h("equals"),g(""),y(""),I(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:f};qe(f)?e.value=parseFloat(p):ze(f)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return n(je,{children:[e(Ue,{value:f,onChange:h,operators:S}),qe(f)&&e(Je,{children:e(Ve,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),ze(f)&&n(Je,{children:[e(Ve,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(Ve,{type:"number",value:C,onChange:I,placeholder:"To...",onEnterPress:x})]}),e(Xe,{onApply:x,onClear:u,canApply:!!Ye(f)||(qe(f)?""!==p.trim():!!ze(f)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},Qe=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(Ke,{value:t,onChange:r,options:o,className:a,placeholder:l})},Ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],f=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),h=f[0],v=f[1],p=Pe("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ye(u)||""!==h;return n(je,{children:[e(Ue,{value:u,onChange:d,operators:p}),qe(u)&&e(Je,{children:e(Qe,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Xe,{onApply:function(){var e={accessor:r.accessor,operator:u};qe(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},en=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,f=o((null==s?void 0:s.operator)||"equals"),h=f[0],v=f[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],m=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],I=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),S=I[0],x=I[1],R=Pe("date");c(function(){var e,n;s?(v(s.operator),m(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),m(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),f=d[0],h=d[1],v=o(""),p=v[0],g=v[1],m=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&m.current&&m.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",w({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:m,type:"text",value:p,placeholder:l,onClick:function(){h(!f)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),h(!f)):"Escape"===e.key&&h(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(q,w({open:f,setOpen:h,onClose:function(){h(!1)},positioning:"absolute",overflow:"visible"},{children:e(K,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),h(!1)},onClose:function(){return h(!1)}})}))]}))};return n(je,{children:[e(Ue,{value:h,onChange:v,operators:R}),qe(h)&&e(Je,{children:e(E,{value:g,onChange:m,placeholder:"Select date...",autoFocus:!0})}),ze(h)&&n(Je,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:S,onChange:x,placeholder:"To date..."})]}),e(Xe,{onApply:function(){var e={accessor:l.accessor,operator:h};qe(h)?e.value=g:ze(h)&&(e.values=[b,S]),u(e)},onClear:d,canApply:!!Ye(h)||(qe(h)?""!==g.trim():!!ze(h)&&""!==b.trim()&&""!==S.trim()),showClear:!!s})]})},nn=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),f=o((null==i?void 0:i.values)?i.values.map(String):d),h=f[0],v=f[1];c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var p=h.length===d.length;return n(je,{children:[e(Je,{children:n("div",w({className:"st-enum-filter-options"},{children:[e("div",w({className:"st-enum-select-all"},{children:e(we,w({checked:p,onChange:function(e){v(e?d:[])}},{children:e("span",w({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(we,w({checked:h.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",w({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Xe,{onApply:function(){if(h.length!==d.length){var e={accessor:r.accessor,operator:"in",values:h};l(e)}else s()},onClear:s,canApply:0!==h.length&&h.length!==d.length,showClear:!!i})]})},tn=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($e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(nn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(_e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},rn=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,f=t.gridColumnStart,h=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,m=t.sort,y=o(!1),I=y[0],S=y[1],x=o(!1),R=x[0],E=x[1],N=o(p.label||""),k=N[0],A=N[1],F=T(),H=F.activeHeaderDropdown,D=F.areAllRowsSelected,M=F.columnBorders,B=F.columnReordering,L=F.columnResizing,W=F.columnsWithSelectedCells,O=F.draggedHeaderRef,P=F.enableHeaderEditing,z=F.enableRowSelection,Y=F.filters,G=F.handleApplyFilter,K=F.handleClearFilter,U=F.handleSelectAll,V=F.headerDropdown,J=F.headerRegistry,X=F.headers,_=F.hoveredHeaderRef,Q=F.onColumnOrderChange,Z=F.onColumnSelect,ee=F.onHeaderEdit,ne=F.onSort,te=F.onTableHeaderDragEnd,re=F.rowHeight,oe=F.selectColumns,ie=F.selectableColumns,le=F.selectedColumns,ce=F.setActiveHeaderDropdown,se=F.setHeaders,ue=F.setInitialFocusedCell,de=F.setIsResizing,fe=F.setSelectedCells,he=F.setSelectedColumns,ve=F.sortDownIcon,ge=F.sortUpIcon,me=Boolean(null==p?void 0:p.isSortable),ye=Boolean(null==p?void 0:p.filterable),be=Y[p.accessor],Ce=(null==H?void 0:H.accessor)===p.accessor,Ie=p.isSelectionColumn&&z,Se=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),f=o({}),h=f[0],v=f[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:h}}({isOpen:Ce,estimatedHeight:200,estimatedWidth:250,margin:4}),xe=Se.triggerRef,Re=Se.position,Ee=a(function(){var e,n,t;if(!M)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[M,X,p.accessor,p.pinned]),Ne=a(function(){return!(!ie||Ie)&&He(p,u).some(function(e){return le.has(e)})},[ie,Ie,p,u,le]),ke=a(function(){return!Ie&&W.has(u)},[Ie,W,u]),Ae="st-header-cell ".concat(p.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=O.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(me?"clickable":""," ").concat(B&&!me?"columnReordering":""," ").concat(p.children?"parent":""," ").concat(Ee?"st-last-column":""," ").concat(P&&!Ie?"st-header-editable":""," ").concat(Ne?"st-header-selected":""," ").concat(ke&&!Ne?"st-header-has-highlighted-cell":""),Fe=ae({draggedHeaderRef:O,headers:X,hoveredHeaderRef:_,onColumnOrderChange:Q,onTableHeaderDragEnd:te}),De=Fe.handleDragStart,Te=Fe.handleDragEnd,Be=Fe.handleDragOver,Le=$();c(function(){if(J&&!p.isSelectionColumn){var e=String(p.accessor);return J.set(e,{setEditing:function(e){E(e)}}),function(){J.delete(e)}}},[J,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Oe=l(function(e){A(e);var n=X.map(function(n){return n.accessor===p.accessor?w(w({},n),{label:e}):n});se(n),ee&&ee(p,e)},[X,se,ee,p]);l(function(){ce&&ce(Ce?null:p)},[ce,Ce,p]);var Pe=l(function(){ce&&ce(null)},[ce]),qe=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=He(t,u),o=r.some(function(e){return le.has(e)});if(P&&o&&!n.shiftKey)return V&&Ce&&Pe(),void E(!0);n.shiftKey&&oe?he(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):oe&&oe(r),fe(new Set),ue(null)}Z&&Z(t),!ie&&t.isSortable&&ne(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!p)return null;var ze=L&&!Ie&&e("div",w({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(C({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Le({callback:Me,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:f,header:p,headers:X,setHeaders:se,setIsResizing:de,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(C({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Le({callback:Me,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:f,header:p,headers:X,setHeaders:se,setIsResizing:de,startWidth:t},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),Ye=m&&m.key.accessor===p.accessor&&n("div",w({className:"st-icon-container",onClick:function(e){return qe({event:e,header:p})}},{children:["ascending"===m.direction&&ge&&ge,"descending"===m.direction&&ve&&ve]})),je=ye&&n("div",w({className:"st-icon-container",onClick:function(e){e.stopPropagation(),S(!I)}},{children:[e(We,{className:"st-header-icon",style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(q,w({open:I,overflow:"visible",setOpen:S,onClose:function(){return S(!1)}},{children:e(tn,{header:p,currentFilter:be,onApplyFilter:function(e){G(e),S(!1)},onClearFilter:function(){K(p.accessor),S(!1)}})}))]}));return n(pe,w({className:Ae,id:C({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ie||Le({callback:Be,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:w(w({gridRowStart:v,gridRowEnd:h,gridColumnStart:f,gridColumnEnd:d},d-f>1?{}:{width:p.width}),h-v>1?{}:{height:re})},{children:[g&&ze,"right"===p.align&&je,"right"===p.align&&Ye,e("div",w({ref:xe,className:"st-header-label",draggable:B&&!p.disableReorder&&!Ie,onClick:function(e){Ie||qe({event:e,header:p})},onDoubleClick:function(e){Ie||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ne(n.accessor)}({event:e,header:p})},onDragEnd:Ie?void 0:function(e){e.preventDefault(),Te()},onDragStart:Ie?void 0:function(e){B&&p&&function(e){De(e)}(p)}},{children:e("span",w({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ie?e(we,{checked:!!D&&D(),onChange:function(e){U&&U(e)}}):R?e(j,{defaultValue:k,onBlur:function(){return E(!1)},onChange:Oe}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&Ye,"right"!==p.align&&je,!g&&ze,V&&!Ie&&e("div",w({className:"st-header-dropdown-container"},{children:V({accessor:p.accessor,colIndex:u,header:p,isOpen:Ce,onClose:Pe,position:Re})}))]}))},on=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,f=n.width,h=a(function(){var e=[],n=1,t=function(o,i,a){var l,u;if(void 0===a&&(a=!1),!I({header:o,pinned:s}))return 0;a||n++;var d=null!==(u=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return I({header:e,pinned:s})}).length)&&void 0!==u?u:0,f=n,h=d>0?f+d:f+1,v=i,p=d>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:h,gridRowStart:v,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach(function(e){I({header:e,pinned:s})&&(t(e,i+1,g),g=!1)})}return h-f},o=l.filter(function(e){return I({header:e,pinned:s})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r]);return e(Ne,w({condition:!s,wrapper:function(n){return e(Ee,w({childRef:u},{children:n}))}},{children:e("div",w({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:f}},{children:e(t,{children:h.map(function(n){return e(rn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},an=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(an)):1},ln=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,h=t.pinnedRightWidth,v=T(),p=v.headerContainerRef,g=v.pinnedLeftRef,m=v.pinnedRightRef,y=a(function(){return Ae({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s})},[o,l,s]),b=a(function(){var e=0;return o.forEach(function(n){if(I({header:n})){var t=an(n);e=Math.max(e,t)}}),{maxDepth:e}},[o]).maxDepth;return n("div",w({className:"st-header-container",ref:p},{children:[ee(o,"left")&&e(on,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:b,pinned:"left",sectionRef:g,sort:d,width:f}),e(on,{columnIndices:y,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:b,sectionRef:r,sort:d}),ee(o,"right")&&e(on,{columnIndices:y,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:b,pinned:"right",sectionRef:m,sort:d,width:h})]}))},cn=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},sn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=T(),f=d.columnResizing,h=d.editColumns,v=d.headers,p=i(null),g=v.filter(function(e){return!e.pinned}),m=v.filter(function(e){return"left"===e.pinned}),y=v.filter(function(e){return"right"===e.pinned}),b=a(function(){return cn({headers:m})},[m]),C=a(function(){return cn({headers:g})},[g]),I=a(function(){return cn({headers:y})},[y]),S={centerHeaderRef:p,headers:v,mainTemplateColumns:C,pinnedLeftColumns:m,pinnedLeftTemplateColumns:b,pinnedRightColumns:y,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},x={tableRows:s,mainTemplateColumns:C,pinnedLeftColumns:m,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:y,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",w({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(ln,w({},S)),e(Fe,w({},x))]}))},un=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=T().editColumns,v=o(!1),p=v[0],g=v[1],m=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=h?28:0,C=(h?d+1:d)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;g(l>e)}}()},1)},[s,l]),p?n("div",w({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=m.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Ee,w({childRef:m},{children:e("div",w({className:"st-horizontal-scrollbar-middle",ref:m,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=m.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},dn={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 dn.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?dn.string(e,n,t):"number"==typeof e&&"number"==typeof n?dn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?dn.boolean(e,n,t):dn.string(String(e),String(n),t)}},fn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return dn.number(i,a,r)}return"date"===t?dn.date(String(e),String(n),r):"boolean"===t?dn.boolean(Boolean(e),Boolean(n),r):"enum"===t?dn.enum(String(e),String(n),r):dn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},hn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return fn({rows:t,sortColumn:r,headers:n})},vn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):hn({headers:i,rows:t,sortColumn:r}):t},pn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(pn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},gn=function(e){return e.every(function(e){return e.hide})},wn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(wn(e.children),gn(e.children)&&(e.hide=!0))})},mn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),f=d[0],h=d[1],v=T(),p=v.expandIcon,g=v.headers,m=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,I=null!=u?u:s.hide||C&&s.children&&gn(s.children);return n(t,{children:[n("div",w({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",w({className:"st-header-icon-container"},{children:C?e("div",w({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e(we,w({checked:I,onChange:function(e){(s.hide=e,e)?wn(i):(pn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,pn(i,s.children[0].accessor)));m(b([],g,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",w({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(mn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!I||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},yn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",w({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",w({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(mn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},bn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],f=u[1];return i?n("div",w({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",w({className:"st-column-editor-text"},{children:r})),e(yn,{headers:l,open:d,position:s})]})):null},Cn=function(n){var t=n.className;return e("svg",w({"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"})}))},In=function(n){var t=n.className;return e("svg",w({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},Sn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),f=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(xe.Provider,w({value:{registerPane:d,unregisterPane:f}},{children:r.Children.only(t)}))},xn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Oe[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)},Rn=function(){var t=T(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",w({className:"st-filter-bar"},{children:e("div",w({className:"st-filter-bar-content"},{children:e("div",w({className:"st-filter-chips"},{children:a.map(function(t){return n("div",w({className:"st-filter-chip"},{children:[e("span",w({className:"st-filter-chip-text"},{children:xn(t,i)})),e("button",w({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},En=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Nn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=En(h),g=En(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return En(new Date(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return En(new Date(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var I=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=I}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),x=o.includes(S);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},kn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return De(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&N(l)){var c=i(l,t+1),s=w({},n);return s[o]=c,e.forEach(function(e){var n=An(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},An=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&N(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Fn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],f=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),h=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=f(e);g(e,!n)}},[f,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:f,areAllRowsSelected:h,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Hn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Dn,w({},n)):null},Dn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,p=void 0!==v&&v,C=t.columnEditorPosition,I=void 0===C?"right":C,R=t.columnEditorText,E=void 0===R?"Columns":R,H=t.columnReordering,T=void 0!==H&&H,O=t.columnResizing,P=void 0!==O&&O,q=t.defaultHeaders,z=t.editColumns,Y=void 0!==z&&z,j=t.editColumnsInitOpen,G=void 0!==j&&j,K=t.enableHeaderEditing,U=void 0!==K&&K,V=t.enableRowSelection,J=void 0!==V&&V,X=t.expandAll,_=void 0===X||X,$=t.expandIcon,Z=void 0===$?e(L,{className:"st-expand-icon"}):$,ee=t.externalFilterHandling,ne=void 0!==ee&&ee,te=t.externalSortHandling,re=void 0!==te&&te,oe=t.headerDropdown,ie=t.height,ae=t.hideFooter,le=void 0!==ae&&ae,ce=t.nextIcon,ue=void 0===ce?e(L,{className:"st-next-prev-icon"}):ce,de=t.onCellEdit,fe=t.onCellClick,he=t.onColumnOrderChange,ve=t.onColumnSelect,pe=t.onFilterChange,ge=t.onGridReady,we=t.onHeaderEdit,me=t.onLoadMore,ye=t.onNextPage,be=t.onRowSelectionChange,Ce=t.onSortChange,Ie=t.prevIcon,Se=void 0===Ie?e(B,{className:"st-next-prev-icon"}):Ie,xe=t.rowButtons,Re=t.rowGrouping,Ee=t.rowHeight,Ne=void 0===Ee?32:Ee,ke=t.rowIdAccessor,Ae=t.rows,Fe=t.selectionColumnWidth,He=void 0===Fe?42:Fe,De=t.rowsPerPage,Te=void 0===De?10:De,Me=t.selectableCells,Be=void 0!==Me&&Me,We=t.selectableColumns,Oe=void 0!==We&&We,Pe=t.shouldPaginate,qe=void 0!==Pe&&Pe,ze=t.sortDownIcon,Ye=void 0===ze?e(Cn,{className:"st-header-icon"}):ze,je=t.sortUpIcon,Ge=void 0===je?e(In,{className:"st-header-icon"}):je,Ke=t.tableRef,Ue=t.theme,Ve=void 0===Ue?"light":Ue,Je=t.useHoverRowBackground,Xe=void 0===Je||Je,_e=t.useOddEvenRowBackground,$e=void 0!==_e&&_e,Qe=t.useOddColumnBackground,Ze=void 0!==Qe&&Qe;Ze&&($e=!1),p&&(Xe=!1);var en=g(function(e){return e+1},0)[1],nn=i(null),tn=i(null),rn=i(null),on=i(null),an=i(null),ln=i(null),cn=i(null),dn=o(1),fn=dn[0],pn=dn[1],gn=o(q),wn=gn[0],mn=gn[1],yn=o(!1),xn=yn[0],En=yn[1],An=o(!1),Hn=An[0],Dn=An[1],Tn=o(null),Mn=Tn[0],Bn=Tn[1];c(function(){mn(q)},[q]);var Ln=Fn({rows:Ae,rowIdAccessor:ke,onRowSelectionChange:be,enableRowSelection:J}),Wn=Ln.selectedRows,On=Ln.setSelectedRows,Pn=Ln.isRowSelected,qn=Ln.areAllRowsSelected,zn=Ln.selectedRowCount,Yn=Ln.selectedRowsData,jn=Ln.handleRowSelect,Gn=Ln.handleSelectAll,Kn=Ln.handleToggleRow,Un=Ln.clearSelection,Vn=a(function(){var e,n=b([],wn,!0);J&&!(null===(e=null==wn?void 0:wn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:He,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[J,wn,He]),Jn=o(0),Xn=Jn[0],_n=Jn[1],$n=o(new Set),Qn=$n[0],Zn=$n[1],et=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:ln}),nt=et.scrollbarWidth,tt=et.setScrollbarWidth,rt=a(function(){var e=Le({headers:Vn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Vn]),ot=rt.mainBodyWidth,it=rt.pinnedLeftWidth,at=rt.pinnedRightWidth,lt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:ie,rowHeight:Ne}),ct=kn({rows:Ae,headers:wn,rowGrouping:Re}),st=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Nn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=w(w({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=w({},c);delete n[e],s(n),null==r||r(n)},[c,r]),h=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=w(w({},c),((r={})[e.accessor]=e,r));return Nn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:ct,externalFilterHandling:ne,onFilterChange:pe}),ut=st.filters,dt=st.filteredRows,ft=st.updateFilter,ht=st.clearFilter,vt=st.clearAllFilters,pt=st.computeFilteredRowsPreview,gt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],f=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=hn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(N(a)){var l=f({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return w(w({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return vn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:f})},[t,u,n,r,c,f]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},vn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:f})},[u,n,t,r,c,f]);return{sort:u,sortedRows:h,updateSort:v,computeSortedRowsPreview:p}}({headers:wn,tableRows:dt,externalSortHandling:re,onSortChange:Ce,rowGrouping:Re}),wt=gt.sort,mt=gt.sortedRows,yt=gt.updateSort,bt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,f=e.rowGrouping,h=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,m=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,S=o(!1),x=S[0],R=S[1],E=o([]),N=E[0],F=E[1],H=i([]),D=i([]),T=i(new Map),M=i(null),B=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return f&&0!==f.length?A({rows:n,rowGrouping:f,rowIdAccessor:h,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,f,h,v,p]);a(function(){if(0===T.current.size){var e=B(r),n=new Map;e.forEach(function(e){var t=String(k({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),T.current=n}},[r,B,h]);var L=a(function(){return B(t)},[t,B]),O=a(function(){return W({bufferRowCount:5,contentHeight:g,tableRows:L,rowHeight:m,scrollTop:y})},[L,g,m,y]),P=l(function(e,n){var t=new Set(e.map(function(e){return String(k({row:e.row,rowIdAccessor:h}))})),r=new Set(n.map(function(e){return String(k({row:e.row,rowIdAccessor:h}))}));return{staying:n.filter(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return t.has(n)}),entering:n.filter(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return!r.has(n)})}},[h]),q=a(function(){if(0===H.current.length)return!1;var e=L.map(function(e){return String(k({row:e.row,rowIdAccessor:h}))}),n=H.current.map(function(e){return String(k({row:e.row,rowIdAccessor:h}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L,h]);d(function(){if(!x){if(!n||u)return F([]),H.current=L,void(D.current=O);if(0===H.current.length)return F([]),H.current=L,void(D.current=O);if(!q)return F([]),H.current=L,void(D.current=O);M.current={tableRows:L,visibleRows:O},R(!0)}},[n,L,q,x,u,O]),d(function(){if(x&&M.current&&N.length>0){var e=setTimeout(function(){var e=M.current;R(!1),F([]),H.current=e.tableRows,D.current=e.visibleRows,M.current=null},se.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var z=a(function(){if(!n||u)return O;if(N.length>0){var e=new Map;return L.forEach(function(n){var t=String(k({row:n.row,rowIdAccessor:h}));e.set(t,n.position)}),N.map(function(n){var t=String(k({row:n.row,rowIdAccessor:h})),r=e.get(t);return void 0!==r?w(w({},n),{position:r}):n})}return O},[O,N,L,n,u,h]),Y=l(function(e){if(n&&!u){var t=C(e),r=B(t),o=W({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=P(O,o).entering.map(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return L.find(function(e){return String(k({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&F(b(b([],O,!0),i,!0))}},[n,u,C,B,g,m,y,P,L,O,h]),j=l(function(e){if(n&&!u){var t=I(e),r=B(t),o=W({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=P(O,o).entering.map(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return L.find(function(e){return String(k({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&F(b(b([],O,!0),i,!0))}},[n,u,I,B,g,m,y,P,L,O,h]);return{currentTableRows:L,currentVisibleRows:O,isAnimating:x,prepareForFilterChange:Y,prepareForSortChange:j,rowsToRender:z}}({allowAnimations:s,sortedRows:mt,originalRows:ct,currentPage:fn,rowsPerPage:Te,shouldPaginate:qe,rowGrouping:Re,rowIdAccessor:ke,unexpandedRows:Qn,expandAll:_,contentHeight:lt,rowHeight:Ne,scrollTop:Xn,computeFilteredRowsPreview:pt,computeSortedRowsPreview:gt.computeSortedRowsPreview}),Ct=bt.currentTableRows,It=bt.rowsToRender,St=bt.prepareForFilterChange,xt=bt.prepareForSortChange,Rt=bt.isAnimating,Et=i(new Map),Nt=i(new Map),kt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,f=o(new Set),h=f[0],v=f[1],p=o(new Set),g=p[0],w=p[1],b=o(null),C=b[0],I=b[1],S=o(null),R=S[0],E=S[1],N=o(new Set),A=N[0],H=N[1],D=o(new Set),T=D[0],M=D[1],B=i(!1),L=i(null),W=a(function(){var e=new Set;return h.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),g.forEach(function(n){e.add(n)}),e},[h,g]),O=a(function(){var e=new Set;return h.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),g.size>0&&r.forEach(function(n){var t=k({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[h,g,r,s]),P=a(function(){return t.flatMap(x)},[t]),q=l(function(){var e=P.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(h).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");h.size>0&&(navigator.clipboard.writeText(o),H(new Set(h)),setTimeout(function(){H(new Set)},800))},[P,h,r]),z=l(function(){return m(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(f){switch(f.label){case 0:if(!R)return[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=f.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=P.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var f=a+n,h=l+c;if(!(f>=r.length||h>=t.length)){var v=r[f],p=t[h],g=k({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:f});var I=F({colIndex:h,rowIndex:f,rowId:g});o.add(I)}else{var S=F({colIndex:h,rowIndex:f,rowId:g});i.add(S)}}})}),o.size>0&&(H(o),setTimeout(function(){H(new Set)},800)),i.size>0&&(M(i),setTimeout(function(){M(new Set)},800)),[3,4]):[2];case 3:return c=f.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,P,r,s,u,d]),Y=l(function(){if(0!==h.size){var e=P.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(h).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],f=e[l],h=k({row:c.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(c.row[f.accessor])?[]:""),c.row[f.accessor]=v,d){var p="".concat(h,"-").concat(f.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:f.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(H(t),setTimeout(function(){H(new Set)},800)),o.size>0&&(M(o),setTimeout(function(){M(new Set)},800))}},[h,P,r,s,u,d]),j=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=k({row:r[c].row,rowIdAccessor:s});t.add(F({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),I(null),v(t)},[r,s,w,I,v]),G=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<P.length){var n=F(e);w(new Set),I(null),v(new Set([n])),E(e)}},[P.length,r.length,w,I,v,E]),K=l(function(e,n){void 0===n&&(n=!1),v(new Set),E(null),w(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[v,E,w,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void z();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(k({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return k({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=k({row:r[o-1].row,rowIdAccessor:s});G({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=k({row:r[o+1].row,rowIdAccessor:s}),G({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=k({row:r[o].row,rowIdAccessor:s}),G({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<P.length-1&&(c=k({row:r[o].row,rowIdAccessor:s}),G({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),w(new Set),I(null),L.current=null,E(null))}else q()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[q,P.length,R,s,j,G,n,r,z,Y]);var U=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r}),i=h.has(o),a=g.has(n);return i||a},[h,g]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?k({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?k({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},f={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!U(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!U(u)||g.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),U(d)||i.push("st-selected-left-border"),U(f)||i.push("st-selected-right-border"),i.join(" ")},[U,r,g,s]),J=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),X=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return A.has(o)},[A]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=F({colIndex:n,rowIndex:t,rowId:r});return T.has(o)},[T]);return{getBorderClass:V,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(B.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){w(new Set),I(null);var e=F({colIndex:t,rowIndex:r,rowId:o});v(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&B.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<r.length){var h=k({row:r[d].row,rowIdAccessor:s});i.add(F({colIndex:f,rowIndex:d,rowId:h}))}v(i)}},handleMouseUp:function(){B.current=!1},isCopyFlashing:X,isWarningFlashing:_,isInitialFocusedCell:J,isSelected:U,lastSelectedColumnIndex:C,pasteFromClipboard:z,selectColumns:K,selectedCells:h,selectedColumns:g,setInitialFocusedCell:E,setSelectedCells:v,setSelectedColumns:w,deleteSelectedCells:Y,columnsWithSelectedCells:W,rowsWithSelectedCells:O}}({selectableCells:Be,headers:wn,tableRows:Ct,rowIdAccessor:ke,onCellEdit:de,cellRegistry:Et.current}),At=kt.getBorderClass,Ft=kt.handleMouseDown,Ht=kt.handleMouseOver,Dt=kt.handleMouseUp,Tt=kt.isCopyFlashing,Mt=kt.isInitialFocusedCell,Bt=kt.isSelected,Lt=kt.isWarningFlashing,Wt=kt.selectColumns,Ot=kt.selectedCells,Pt=kt.selectedColumns,qt=kt.setInitialFocusedCell,zt=kt.setSelectedCells,Yt=kt.setSelectedColumns,jt=kt.columnsWithSelectedCells,Gt=kt.rowsWithSelectedCells,Kt=l(function(e){xt(e),setTimeout(function(){yt(e)},0)},[xt,yt]),Ut=l(function(e){mn(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Oe,selectedCells:Ot,selectedColumns:Pt,setSelectedCells:zt,setSelectedColumns:Yt,activeHeaderDropdown:Mn,setActiveHeaderDropdown:Bn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:en,tableBodyContainerRef:ln,setScrollbarWidth:tt}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:ge}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef,i=e.headerRegistryRef;c(function(){n&&(n.current={updateData:function(e){var n=e.accessor,i=e.rowIndex,a=e.newValue,l=null==t?void 0:t[i];if(l){var c=k({row:l,rowIdAccessor:r}),s=S({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=i.current.get(String(n));t&&t.setEditing(!0)}})},[o,i,t,r,n])}({cellRegistryRef:Et,headerRegistryRef:Nt,rowIdAccessor:ke,rows:Ae,tableRef:Ke}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:ut,onFilterChange:pe}),function(e){var n=e.sort,t=e.onSortChange,r=Q(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:wt,onSortChange:Ce});var Vt=l(function(e){St(e),setTimeout(function(){ft(e)},0)},[St,ft]);return e(D,w({value:{allowAnimations:s,areAllRowsSelected:qn,cellRegistry:Et.current,cellUpdateFlash:f,clearSelection:Un,columnBorders:p,columnReordering:T,columnResizing:P,draggedHeaderRef:nn,editColumns:Y,enableHeaderEditing:U,enableRowSelection:J,expandIcon:Z,filters:ut,forceUpdate:en,getBorderClass:At,handleApplyFilter:Vt,handleClearAllFilters:vt,handleClearFilter:ht,handleMouseDown:Ft,handleMouseOver:Ht,handleRowSelect:jn,handleSelectAll:Gn,handleToggleRow:Kn,headerContainerRef:cn,headerRegistry:Nt.current,headers:Vn,hoveredHeaderRef:tn,isAnimating:Rt,isCopyFlashing:Tt,isInitialFocusedCell:Mt,isResizing:xn,isRowSelected:Pn,isScrolling:Hn,isSelected:Bt,isWarningFlashing:Lt,mainBodyRef:rn,nextIcon:ue,onCellEdit:de,onCellClick:fe,onColumnOrderChange:he,onColumnSelect:ve,onLoadMore:me,onSort:Kt,onTableHeaderDragEnd:Ut,pinnedLeftRef:on,pinnedRightRef:an,prevIcon:Se,rowButtons:xe,rowGrouping:Re,rowHeight:Ne,rowIdAccessor:ke,scrollbarWidth:nt,selectColumns:Wt,selectableColumns:Oe,selectedColumns:Pt,columnsWithSelectedCells:jt,rowsWithSelectedCells:Gt,selectedRows:Wn,selectedRowCount:zn,selectedRowsData:Yn,setHeaders:mn,setInitialFocusedCell:qt,setIsResizing:En,setIsScrolling:Dn,setSelectedCells:zt,setSelectedColumns:Yt,setSelectedRows:On,setUnexpandedRows:Zn,shouldPaginate:qe,sortDownIcon:Ye,sortUpIcon:Ge,tableBodyContainerRef:ln,tableRows:Ct,theme:Ve,unexpandedRows:Qn,useHoverRowBackground:Xe,useOddColumnBackground:Ze,useOddEvenRowBackground:$e,headerDropdown:oe,activeHeaderDropdown:Mn,setActiveHeaderDropdown:Bn,onHeaderEdit:we}},{children:e("div",w({className:"simple-table-root st-wrapper theme-".concat(Ve," ").concat(null!=h?h:""," ").concat(p?"st-column-borders":""),style:ie?{height:ie}:{}},{children:e(Sn,{children:n("div",w({className:"st-wrapper-container"},{children:[e(Rn,{}),n("div",w({className:"st-content-wrapper",onMouseUp:Dt,onMouseLeave:Dt},{children:[e(sn,{pinnedLeftWidth:it,pinnedRightWidth:at,setScrollTop:_n,sort:wt,tableRows:Ct,rowsToRender:It}),e(bn,{columnEditorText:E,editColumns:Y,editColumnsInitOpen:G,headers:wn,position:I})]})),e(un,{mainBodyRef:rn,mainBodyWidth:ot,pinnedLeftWidth:it,pinnedRightWidth:at,tableBodyContainerRef:ln}),e(M,{currentPage:fn,hideFooter:le,onPageChange:pn,onNextPage:ye,shouldPaginate:qe,totalPages:Math.ceil(mt.length/Te)})]}))})}))}))};export{Hn as SimpleTable};
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as f,cloneElement as h,forwardRef as v,useImperativeHandle as p,useReducer as g}from"react";var w=function(){return w=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},w.apply(this,arguments)};function m(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},S=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},I=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},x=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return x(e)}):[e]},R=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(C({accessor:e.accessor,rowId:"header"}));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(C({accessor:e.accessor,rowId:"header"})))||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){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},A=function(e){return e.row[e.rowIdAccessor]},F=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=A({row:t,rowIdAccessor:c}),f=l[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return k(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},H=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},D=s(void 0),T=function(n){var t=n.children,r=n.value;return e(D.Provider,w({value:r},{children:t}))},M=function(){var e=u(D);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},W=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=M(),d=u.nextIcon,f=u.prevIcon,h=o(!0),v=h[0],p=h[1],g=!(r>1),b=!(r<s)&&!l||!v&&r===s;if(i||!c)return null;var C=function(){if(s<=15)return Array.from({length:s},function(e,n){return n+1});var e,n,t=[],o=15;if(r<=Math.ceil(7.5))e=1,n=14;else if(r>=s-Math.floor(7.5))e=Math.max(1,s-o+1),n=s;else{var i=Math.floor(7);e=r-i,n=r+(o-i-1)}for(var a=e;a<=n;a++)t.push(a);return n<s-1&&(t.push(-1),t.push(s)),t}();return n("div",w({className:"st-footer"},{children:[e("button",w({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:f})),e("button",w({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",w({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",w({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},B=function(n){var t=n.className;return e("svg",w({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",w({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"})}))},O=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},P=function(e){return e.position*(e.rowHeight+1)-1},q=function(e){return e.position*(e.rowHeight+1)},z=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,f=n.containerRef,h=n.positioning,v=void 0===h?"fixed":h,p=M().mainBodyRef,g=i(null),m=i(null),y=o("bottom-left"),b=y[0],C=y[1],S=o({}),I=S[0],x=S[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!m.current&&g.current.parentElement&&(m.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&m.current){var e,n=g.current,t=m.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==p?void 0:p.current)?p.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,f,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",w({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:w(w({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},I),{overflow:s})},{children:t})):null},Y=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",w({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},j=function(t){var r=t.onBlur,i=t.onChange,a=t.open,l=t.setOpen,c=t.value,s=o(c),u=s[0],d=s[1],f=function(e){d(e),i(e),l(!1),r()};return n(z,w({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(Y,w({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(Y,w({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},G=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},K=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},U=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=M(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],p=h[1],g=o("days"),m=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",w({className:"st-datepicker"},{children:[n("div",w({className:"st-datepicker-header"},{children:["days"===m&&n(t,{children:[e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",w({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",w({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===m&&e("div",w({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===m&&e("div",w({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",w({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",w({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",w({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var f=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=o===new Date(s).getDate()&&r===new Date(s).getMonth()&&t===new Date(s).getFullYear();n.push(e("div",w({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)))},h=1;h<=o;h++)f(h);var g=35-(i+o),m=function(t){n.push(e("div",w({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(h=1;h<=g;h++)m(h);return n}(),"months"===m&&(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",w({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===m&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",w({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",w({className:"st-datepicker-footer"},{children:e("button",w({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},V=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},J=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(z,w({open:o,onClose:l,setOpen:i,width:280},{children:e(U,{value:V(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},X=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(z,w({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",w({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(Y,w({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},_=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(j,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(J,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(X,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(K,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(G,{defaultValue:u,onBlur:s,onChange:o})},$=0,Q=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===$||o-$>=r)&&($=o,n(t))}},Z=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},ee=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ee);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ee(e[t]));return n},ne=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},te=Date.now(),re={screenX:0,screenY:0},oe=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return b(b([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=oe(o.children,n,b(b([],t,!0),[r],!1));if(i)return i}}return null},ie=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function ae(e,n,t){var r,o,i=ee(e),a=!1;try{var l=ie(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=w({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),f=s;i.splice(f,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var le=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=M().setHeaders,l=Z(t);return{handleDragStart:function(e){n.current=e,te=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-re.screenX,2)+Math.pow(u-re.screenY,2));r.current=a;var f,h=n.current,v=!1;if(ie(h)!==ie(a)){f=(S=ae(t,h,a)).newHeaders,v=S.emergencyBreak}else{var p=t,g=oe(p,h.accessor),w=oe(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var S=function(e,n,t){var r=ee(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=S.newHeaders,v=S.emergencyBreak}if(!(c||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(I-te<1500||d<40)||(te=I,re={screenX:s,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return b([],e,!0)}),null==o||o(t)},10)}}},ce=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},se={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ue={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},de={duration:150,easing:"ease-out",delay:0},fe=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},he=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){fe(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ve=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return m(void 0,void 0,void 0,function(){var e,i,a;return y(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:ce()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),ce()?w(w({},de),e):w(w({},"column"===n?se:ue),e)}(t,i?"column":"row"),fe(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,he(n,a,t)]);case 1:return l.sent(),[2]}})})},pe=function(e){var n=e.element,t=e.options;return m(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,f,h,v,p,g,w;return y(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,f=t.respectReducedMotion,h=void 0===f||f,ce()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},ge=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=M(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),p=i(null),g=Z(f),m=Z(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=w(w({},ue),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,S=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==S){var I=5*h,x=b-I,R=b+C+I,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,k=i.y<b,A=i.y>b+C,F=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,H=.6*h,D=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&A){var T=b+C+D(i.y,b,b+C)+F%15*H*2.5+F%7*(.4*h);return void pe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&k){T=b-D(i.y,b,b+C)-F%15*H*2.5-F%7*(.4*h);return void pe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+D(l.y,b,b+C)+F%10*H*1;return void pe({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){M=b-D(l.y,b,b+C)-F%10*H*1;return void pe({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}ve({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,f,o,g,m,h,null==a?void 0:a.position,a]),e("div",w({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};ge.displayName="Animate";var we=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:w({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"})}))},me=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",w({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",w({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(we,{className:"st-checkbox-checkmark"})})),i]}))},ye=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},be=function(t){var r=t.borderClass,s=t.colIndex,u=t.header,d=t.isHighlighted,f=t.isInitialFocused,h=t.nestedIndex,v=t.rowIndex,p=t.tableRow,g=M(),m=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,S=g.draggedHeaderRef,x=g.enableRowSelection,R=g.expandIcon,E=g.handleMouseDown,N=g.handleMouseOver,F=g.handleRowSelect,H=g.headers,D=g.hoveredHeaderRef,T=g.isCopyFlashing,W=g.isRowSelected,B=g.isWarningFlashing,L=g.onCellEdit,O=g.onCellClick,P=g.onTableHeaderDragEnd,q=g.rowButtons,z=g.rowGrouping,Y=g.rowIdAccessor,j=g.rowsWithSelectedCells,G=g.selectedColumns,K=g.setUnexpandedRows,U=g.tableBodyContainerRef,V=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,$=p.depth,Z=p.row,ee=o(Z[u.accessor]),ne=ee[0],te=ee[1],re=o(!1),oe=re[0],ie=re[1],ae=o(!1),ce=ae[0],se=ae[1],ue=o(!1),de=ue[0],fe=ue[1],he=i(null),ve=A({row:Z,rowIdAccessor:Y}),pe=z&&z[$],we=!!pe&&function(e,n){if(!n)return!1;var t=e[n];return k(t)}(Z,pe),be=!J.has(String(ve)),Ce=T({rowIndex:v,colIndex:s,rowId:ve}),Se=B({rowIndex:v,colIndex:s,rowId:ve}),Ie=a(function(){var e,n,t;if(!b)return!1;var r=H.filter(function(e){return"left"===e.pinned}),o=H.filter(function(e){return!e.pinned}),i=H.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,H,u.accessor,u.pinned]),xe=le({draggedHeaderRef:S,headers:H,hoveredHeaderRef:D,onTableHeaderDragEnd:P}).handleDragOver,Re=Q(),Ee=C({accessor:u.accessor,rowId:ve}),Ne=I({rowId:ve,accessor:u.accessor}),ke=u.isSelectionColumn&&x;c(function(){if(m){var e="".concat(ve,"-").concat(u.accessor);return m.set(e,{updateContent:function(e){ne!==e?(te(e),y&&(se(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){se(!1)},800))):te(e)}}),function(){m.delete(e),he.current&&clearTimeout(he.current)}}},[m,y,ve,u.accessor,ne]),c(function(){if(ce){var e=setTimeout(function(){se(!1)},850);return function(){return clearTimeout(e)}}},[ce]),c(function(){te(Z[u.accessor])},[Z,u.accessor]);var Ae="boolean"===u.type||"date"===u.type||"enum"===u.type,Fe=Boolean(null==u?void 0:u.isEditable),He=G.has(s),De=d&&!He,Te=a(function(){return!!ke&&j.has(String(ve))},[ke,j,ve]),Me="st-cell ".concat($>0&&u.expandable?"st-cell-depth-".concat($):""," ").concat(De?f?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(He?f?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Fe?"clickable":""," ").concat(ce?f?"st-cell-updating-first":"st-cell-updating":""," ").concat(Ce?f?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Se?f?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?h%2==0?"even-column":"odd-column":""," ").concat(ke?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(Ie?"st-last-column":""),We=l(function(e){te(e),Z[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:Z,rowIndex:v})},[u.accessor,L,Z,v]),Be=l(function(){K(function(e){var n=new Set(e),t=String(ve);return n.has(t)?n.delete(t):n.add(t),n})},[ve,K]);return!oe||Ae||ke?n(ge,w({className:Me,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":ve,"data-row-index":v,id:Ee,onClick:function(){O&&!ke&&O({accessor:u.accessor,colIndex:s,row:Z,rowId:ve,rowIndex:v,value:ne})},onDoubleClick:function(){return u.isEditable&&!ke&&ie(!0)},onDragOver:function(e){ke||Re({callback:xe,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){oe||ke||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||oe||(e.preventDefault(),ie(!0))},onMouseDown:function(){oe||ke||E({rowIndex:v,colIndex:s,rowId:ve})},onMouseEnter:function(){fe(!0)},onMouseLeave:function(){fe(!1)},onMouseOver:function(){oe||ke||N({rowIndex:v,colIndex:s,rowId:ve})},parentRef:U,tableRow:p},{children:[u.expandable&&we?e("div",w({className:"st-icon-container st-expand-icon-container ".concat(be?"expanded":"collapsed"),onClick:Be},{children:R})):null,e("span",w({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:ke?n("div",w({className:"st-selection-cell-content"},{children:[e("div",w({className:"st-selection-control"},{children:de||W&&W(String(ve))?e(me,{checked:!!W&&W(String(ve)),onChange:function(e){F&&F(String(ve),e)}}):e("span",w({className:"st-row-number"},{children:v+1}))})),function(){if(!q||!ke||0===q.length)return null;if(!(de||W&&W(String(ve))))return null;var n={row:Z};return e("div",w({className:"st-row-buttons"},{children:q.map(function(t,r){return e("span",w({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:Z,theme:V}):ye({content:ne,header:u})})})),oe&&Ae&&!ke&&e(_,{enumOptions:u.enumOptions,onChange:We,setIsEditing:ie,type:u.type,value:ne})]}),Ne):e("div",w({className:"st-cell-editing",id:C({accessor:u.accessor,rowId:ve}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(_,{enumOptions:u.enumOptions,onChange:We,setIsEditing:ie,type:u.type,value:ne})}))},Ce=function(n){var r=n.columnIndexStart,o=n.columnIndices,i=n.headers,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=M().rowIdAccessor,d=i.filter(function(e){return S({header:e,pinned:a})});return e(t,{children:d.map(function(n,t){var d=A({row:s.row,rowIdAccessor:u}),f=C({accessor:n.accessor,rowId:d});return e(Se,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},Se=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=M(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=A({row:s.row,rowIdAccessor:g});if(r.children){var m=r.children.filter(function(e){return S({header:e,pinned:a})});return e(f,{children:m.map(function(n){var r=C({accessor:n.accessor,rowId:w});return e(Se,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var y={rowIndex:l,colIndex:u,rowId:w},b=h(y),I=v(y),x=p(y),R=C({accessor:r.accessor,rowId:w});return e(be,{borderClass:b,colIndex:u,header:r,isHighlighted:I,isInitialFocused:x,nestedIndex:i,rowIndex:l,tableRow:s},R)},Ie=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.hoveredIndex,l=n.index,c=n.pinned,s=n.rowHeight,u=n.rowIndices,d=n.setHoveredIndex,f=n.tableRow,h=M(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,m=h.isRowSelected,y=h.useOddEvenRowBackground,b=f.position,C=b%2==0,S=A({row:f.row,rowIdAccessor:p}),I=!!m&&m(String(S));return e("div",w({className:"st-row ".concat(y?C?"even":"odd":""," ").concat(a===l&&v?"hovered":""," ").concat(I?"selected":""),onMouseEnter:function(){g||d(l)},style:{gridTemplateColumns:o,top:q({position:b,rowHeight:s}),height:"".concat(s,"px")}},{children:e(Ce,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:b,rowIndices:u,tableRow:f},S)}))},xe=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",w({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:P({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},Re=s(void 0),Ee=["default"],Ne=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(Re);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),o=r.registerPane,i=r.unregisterPane;return c(function(){return n.current&&o(n.current,Ee),function(){n.current&&i(n.current,Ee)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},ke=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},Ae=v(function(t,r){var o=t.columnIndexStart,l=t.columnIndices,c=t.headers,s=t.hoveredIndex,u=t.pinned,d=t.rowHeight,h=t.rowIndices,v=t.setHoveredIndex,g=t.templateColumns,m=t.totalHeight,y=t.rowsToRender,b=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main",S=M().rowIdAccessor,I=i(null);return p(r,function(){return I.current},[]),a(function(){return ne(c,u)},[c,u])?e(ke,w({condition:!u,wrapper:function(n){return e(Ne,w({childRef:I},{children:n}))}},{children:e("div",w({className:C,ref:I,style:w({position:"relative",height:"".concat(m,"px"),width:b},!u&&{flexGrow:1})},{children:y.map(function(t,r){var i=A({row:t.row,rowIdAccessor:S});return n(f,{children:[0!==r&&e(xe,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:d,templateColumns:g,rowIndex:r-1}),e(Ie,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:g,headers:c,hoveredIndex:s,index:r,pinned:u,rowHeight:d,rowIndices:h,setHoveredIndex:v,tableRow:t},i)]},i)})}))})):null});function Fe(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return S({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&S({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}Ae.displayName="TableSection";var He=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,f=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,p=t.rowsToRender,g=t.setScrollTop,m=t.tableRows,y=M(),b=y.headerContainerRef,C=y.headers,S=y.isAnimating,I=y.mainBodyRef,x=y.onLoadMore,R=y.rowHeight,E=y.rowIdAccessor,N=y.scrollbarWidth,k=y.setIsScrolling,F=y.shouldPaginate,H=y.tableBodyContainerRef,D=o(null),T=D[0],W=D[1],B=o(!1),L=B[0],O=B[1];c(function(){S&&null!==T&&W(null)},[S,T]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:b,mainSectionRef:H,scrollbarWidth:N}),c(function(){return function(){q.current&&clearTimeout(q.current)}},[]);var P=i(null),q=i(null),z=i(0),Y=function(e){return e.length}(m),j=Y*(R+1)-1,G=a(function(){return Fe({headers:C,pinnedLeftColumns:s,pinnedRightColumns:f})},[C,s,f]),K=a(function(){var e={};return p.forEach(function(n,t){var r=String(A({row:n.row,rowIdAccessor:E}));e[r]=t}),e},[p,E]),U=l(function(e,n){if(x&&!F&&!L){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(O(!0),x(),setTimeout(function(){O(!1)},1e3))}},[x,F,L]),V={columnIndices:G,headerContainerRef:b,headers:C,hoveredIndex:T,rowHeight:R,rowIndices:K,rowsToRender:p,setHoveredIndex:W};return n("div",w({className:"st-body-container",onMouseLeave:function(){return W(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){k(!1)},150),P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){g(t),U(n,t),z.current=t})},ref:H},{children:[e(Ae,w({},V,{pinned:"left",templateColumns:u,totalHeight:j,width:d})),e(Ae,w({},V,{columnIndexStart:s.length,ref:I,templateColumns:r,totalHeight:j})),e(Ae,w({},V,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:j,width:v}))]}))},De=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},Te=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,Te(e.children)),n})},Me=function(e){return void 0===e&&(e=0),e?e+1:0},We=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var s="clientX"in n?n.clientX:n.touches[0].clientX,u="touches"in n;if(o&&!o.hide){l(!0);var d=N(o),f=t-r>1,h=f?x(o):[o],v=function(e){var n="right"===o.pinned?s-e:e-s,t=function(e){var n=e.header,t=e.headers,r=document.querySelector(".st-body-container");if(!r||0===r.clientWidth)return 1e3;var o=r.clientWidth,i=.8*o;if(!n.pinned)return Math.max(.6*o,600);var a=i-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+x(n).reduce(function(e,n){return e+R(n)},0)},0),l=N(n);return a<l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):a}({header:o,headers:i});if(f&&h.length>1)Be({delta:n,leafHeaders:h,minWidth:d,startWidth:c,maxWidth:t});else{var r=Math.max(Math.min(c+n,t),d);o.width=r}i.forEach(function(e){E(e)});var l=b([],i,!0);a(l)};if(u){var p=function(e){var n=e.touches[0];v(n.clientX)},g=function(){document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g),l(!1)};document.addEventListener("touchmove",p),document.addEventListener("touchend",g)}else{var w=function(e){v(e.clientX)},m=function(){document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",m),l(!1)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",m)}}},Be=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,N(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},Le=function(n){var t=n.className,r=n.style;return e("svg",w({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:w({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"})}))},Oe={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"},Pe=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},qe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},ze=function(e){return["between","notBetween","in","notIn"].includes(e)},Ye=function(e){return["isEmpty","isNotEmpty"].includes(e)},je=function(n){var t=n.children;return e("div",w({className:"st-filter-container"},{children:t}))},Ge=function(){return e("svg",w({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,l=t.options,s=t.placeholder,u=void 0===s?"Select...":s,d=t.className,f=void 0===d?"":d,h=t.disabled,v=void 0!==h&&h,p=o(!1),g=p[0],m=p[1],y=o(-1),b=y[0],C=y[1],S=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),m(!1),C(-1));break;case"Escape":e.preventDefault(),m(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",w({ref:S,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",w({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(m(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",w({className:"st-custom-select-value"},{children:I?I.label:u})),e(Ge,{})]})),e(z,w({open:g,setOpen:m,onClose:function(){m(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",w({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",w({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),m(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},Ue=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Oe[e]}});return e("div",w({className:"st-filter-section"},{children:e(Ke,{value:t,onChange:function(e){r(e)},options:o})}))},Ve=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},Je=function(n){var t=n.children,r=n.className;return e("div",w({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Xe=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",w({className:"st-filter-actions"},{children:[e("button",w({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",w({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},_e=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],f=o(String((null==i?void 0:i.value)||"")),h=f[0],v=f[1],p=Pe("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=w({accessor:r.accessor,operator:u},qe(u)&&{value:h});a(e)},m=Ye(u)||h.trim();return n(je,{children:[e(Ue,{value:u,onChange:d,operators:p}),qe(u)&&e(Je,{children:e(Ve,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Xe,{onApply:g,onClear:l,canApply:!!m,showClear:!!i})]})},$e=function(t){var r,i,a=t.header,l=t.currentFilter,s=t.onApplyFilter,u=t.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),f=d[0],h=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],S=b[1],I=Pe("number");c(function(){var e,n;l?(h(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(h("equals"),g(""),y(""),S(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:f};qe(f)?e.value=parseFloat(p):ze(f)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return n(je,{children:[e(Ue,{value:f,onChange:h,operators:I}),qe(f)&&e(Je,{children:e(Ve,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),ze(f)&&n(Je,{children:[e(Ve,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(Ve,{type:"number",value:C,onChange:S,placeholder:"To...",onEnterPress:x})]}),e(Xe,{onApply:x,onClear:u,canApply:!!Ye(f)||(qe(f)?""!==p.trim():!!ze(f)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},Qe=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(Ke,{value:t,onChange:r,options:o,className:a,placeholder:l})},Ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],f=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),h=f[0],v=f[1],p=Pe("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ye(u)||""!==h;return n(je,{children:[e(Ue,{value:u,onChange:d,operators:p}),qe(u)&&e(Je,{children:e(Qe,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Xe,{onApply:function(){var e={accessor:r.accessor,operator:u};qe(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},en=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,f=o((null==s?void 0:s.operator)||"equals"),h=f[0],v=f[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],m=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],S=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=S[0],x=S[1],R=Pe("date");c(function(){var e,n;s?(v(s.operator),m(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),m(""),C(""),x(""))},[s]);var E=function(t){var r=t.value,a=t.onChange,l=t.placeholder,s=t.autoFocus,u=t.className,d=o(!1),f=d[0],h=d[1],v=o(""),p=v[0],g=v[1],m=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&m.current&&m.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",w({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:m,type:"text",value:p,placeholder:l,onClick:function(){h(!f)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),h(!f)):"Escape"===e.key&&h(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(z,w({open:f,setOpen:h,onClose:function(){h(!1)},positioning:"absolute",overflow:"visible"},{children:e(U,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),h(!1)},onClose:function(){return h(!1)}})}))]}))};return n(je,{children:[e(Ue,{value:h,onChange:v,operators:R}),qe(h)&&e(Je,{children:e(E,{value:g,onChange:m,placeholder:"Select date...",autoFocus:!0})}),ze(h)&&n(Je,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:I,onChange:x,placeholder:"To date..."})]}),e(Xe,{onApply:function(){var e={accessor:l.accessor,operator:h};qe(h)?e.value=g:ze(h)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Ye(h)||(qe(h)?""!==g.trim():!!ze(h)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},nn=function(t){var r=t.header,i=t.currentFilter,l=t.onApplyFilter,s=t.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),f=o((null==i?void 0:i.values)?i.values.map(String):d),h=f[0],v=f[1];c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var p=h.length===d.length;return n(je,{children:[e(Je,{children:n("div",w({className:"st-enum-filter-options"},{children:[e("div",w({className:"st-enum-select-all"},{children:e(me,w({checked:p,onChange:function(e){v(e?d:[])}},{children:e("span",w({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(me,w({checked:h.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):b(b([],n,!0),[e],!1)});var e}},{children:e("span",w({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Xe,{onApply:function(){if(h.length!==d.length){var e={accessor:r.accessor,operator:"in",values:h};l(e)}else s()},onClear:s,canApply:0!==h.length&&h.length!==d.length,showClear:!!i})]})},tn=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($e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(nn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(_e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},rn=function(t){var r,s,u=t.colIndex,d=t.gridColumnEnd,f=t.gridColumnStart,h=t.gridRowEnd,v=t.gridRowStart,p=t.header,g=t.reverse,m=t.sort,y=o(!1),S=y[0],I=y[1],x=o(!1),R=x[0],E=x[1],N=o(p.label||""),k=N[0],A=N[1],F=M(),H=F.activeHeaderDropdown,D=F.areAllRowsSelected,T=F.columnBorders,W=F.columnReordering,B=F.columnResizing,L=F.columnsWithSelectedCells,O=F.draggedHeaderRef,P=F.enableHeaderEditing,q=F.enableRowSelection,Y=F.filters,j=F.handleApplyFilter,K=F.handleClearFilter,U=F.handleSelectAll,V=F.headerDropdown,J=F.headerRegistry,X=F.headers,_=F.hoveredHeaderRef,$=F.onColumnOrderChange,Z=F.onColumnSelect,ee=F.onHeaderEdit,ne=F.onSort,te=F.onTableHeaderDragEnd,re=F.rowHeight,oe=F.selectColumns,ie=F.selectableColumns,ae=F.selectedColumns,ce=F.setActiveHeaderDropdown,se=F.setHeaders,ue=F.setInitialFocusedCell,de=F.setIsResizing,fe=F.setSelectedCells,he=F.setSelectedColumns,ve=F.sortDownIcon,pe=F.sortUpIcon,we=Boolean(null==p?void 0:p.isSortable),ye=Boolean(null==p?void 0:p.filterable),be=Y[p.accessor],Ce=(null==H?void 0:H.accessor)===p.accessor,Se=p.isSelectionColumn&&q,Ie=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),f=o({}),h=f[0],v=f[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:h}}({isOpen:Ce,estimatedHeight:200,estimatedWidth:250,margin:4}),xe=Ie.triggerRef,Re=Ie.position,Ee=a(function(){var e,n,t;if(!T)return!1;var r=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[T,X,p.accessor,p.pinned]),Ne=a(function(){return!(!ie||Se)&&De(p,u).some(function(e){return ae.has(e)})},[ie,Se,p,u,ae]),ke=a(function(){return!Se&&L.has(u)},[Se,L,u]),Ae="st-header-cell ".concat(p.accessor===(null===(r=_.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=O.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(we?"clickable":""," ").concat(W&&!we?"columnReordering":""," ").concat(p.children?"parent":""," ").concat(Ee?"st-last-column":""," ").concat(P&&!Se?"st-header-editable":""," ").concat(Ne?"st-header-selected":""," ").concat(ke&&!Ne?"st-header-has-highlighted-cell":""),Fe=le({draggedHeaderRef:O,headers:X,hoveredHeaderRef:_,onColumnOrderChange:$,onTableHeaderDragEnd:te}),He=Fe.handleDragStart,Te=Fe.handleDragEnd,Me=Fe.handleDragOver,Be=Q();c(function(){if(J&&!p.isSelectionColumn){var e=String(p.accessor);return J.set(e,{setEditing:function(e){E(e)}}),function(){J.delete(e)}}},[J,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Oe=l(function(e){A(e);var n=X.map(function(n){return n.accessor===p.accessor?w(w({},n),{label:e}):n});se(n),ee&&ee(p,e)},[X,se,ee,p]);l(function(){ce&&ce(Ce?null:p)},[ce,Ce,p]);var Pe=l(function(){ce&&ce(null)},[ce]),qe=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ie){var r=De(t,u),o=r.some(function(e){return ae.has(e)});if(P&&o&&!n.shiftKey)return V&&Ce&&Pe(),void E(!0);n.shiftKey&&oe?he(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):oe&&oe(r),fe(new Set),ue(null)}Z&&Z(t),!ie&&t.isSortable&&ne(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!p)return null;var ze=B&&!Se&&e("div",w({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(C({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Be({callback:We,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:f,header:p,headers:X,setHeaders:se,setIsResizing:de,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(C({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Be({callback:We,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:f,header:p,headers:X,setHeaders:se,setIsResizing:de,startWidth:t},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),Ye=m&&m.key.accessor===p.accessor&&n("div",w({className:"st-icon-container",onClick:function(e){return qe({event:e,header:p})}},{children:["ascending"===m.direction&&pe&&pe,"descending"===m.direction&&ve&&ve]})),je=ye&&n("div",w({className:"st-icon-container",onClick:function(e){e.stopPropagation(),I(!S)}},{children:[e(Le,{className:"st-header-icon",style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(z,w({open:S,overflow:"visible",setOpen:I,onClose:function(){return I(!1)}},{children:e(tn,{header:p,currentFilter:be,onApplyFilter:function(e){j(e),I(!1)},onClearFilter:function(){K(p.accessor),I(!1)}})}))]}));return n(ge,w({className:Ae,id:C({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Se||Be({callback:Me,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:w(w({gridRowStart:v,gridRowEnd:h,gridColumnStart:f,gridColumnEnd:d},d-f>1?{}:{width:p.width}),h-v>1?{}:{height:re})},{children:[g&&ze,"right"===p.align&&je,"right"===p.align&&Ye,e("div",w({ref:xe,className:"st-header-label",draggable:W&&!p.disableReorder&&!Se,onClick:function(e){Se||qe({event:e,header:p})},onDoubleClick:function(e){Se||function(e){e.event;var n=e.header;n.isSelectionColumn||ie&&n.isSortable&&ne(n.accessor)}({event:e,header:p})},onDragEnd:Se?void 0:function(e){e.preventDefault(),Te()},onDragStart:Se?void 0:function(e){W&&p&&function(e){He(e)}(p)}},{children:e("span",w({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Se?e(me,{checked:!!D&&D(),onChange:function(e){U&&U(e)}}):R?e(G,{defaultValue:k,onBlur:function(){return E(!1)},onChange:Oe}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))})),"right"!==p.align&&Ye,"right"!==p.align&&je,!g&&ze,V&&!Se&&e("div",w({className:"st-header-dropdown-container"},{children:V({accessor:p.accessor,colIndex:u,header:p,isOpen:Ce,onClose:Pe,position:Re})}))]}))},on=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.handleScroll,l=n.headers,c=n.maxDepth,s=n.pinned,u=n.sectionRef,d=n.sort,f=n.width,h=a(function(){var e=[],n=1,t=function(o,i,a){var l,u;if(void 0===a&&(a=!1),!S({header:o,pinned:s}))return 0;a||n++;var d=null!==(u=null===(l=o.children)||void 0===l?void 0:l.filter(function(e){return S({header:e,pinned:s})}).length)&&void 0!==u?u:0,f=n,h=d>0?f+d:f+1,v=i,p=d>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:h,gridRowStart:v,gridRowEnd:p,colIndex:r[o.accessor]}),o.children){var g=!0;o.children.forEach(function(e){S({header:e,pinned:s})&&(t(e,i+1,g),g=!1)})}return h-f},o=l.filter(function(e){return S({header:e,pinned:s})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r]);return e(ke,w({condition:!s,wrapper:function(n){return e(Ne,w({childRef:u},{children:n}))}},{children:e("div",w({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:f}},{children:e(t,{children:h.map(function(n){return e(rn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},an=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(an)):1},ln=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,l=t.pinnedLeftColumns,c=t.pinnedLeftTemplateColumns,s=t.pinnedRightColumns,u=t.pinnedRightTemplateColumns,d=t.sort,f=t.pinnedLeftWidth,h=t.pinnedRightWidth,v=M(),p=v.headerContainerRef,g=v.pinnedLeftRef,m=v.pinnedRightRef,y=a(function(){return Fe({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s})},[o,l,s]),b=a(function(){var e=0;return o.forEach(function(n){if(S({header:n})){var t=an(n);e=Math.max(e,t)}}),{maxDepth:e}},[o]).maxDepth;return n("div",w({className:"st-header-container",ref:p},{children:[ne(o,"left")&&e(on,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:b,pinned:"left",sectionRef:g,sort:d,width:f}),e(on,{columnIndices:y,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:b,sectionRef:r,sort:d}),ne(o,"right")&&e(on,{columnIndices:y,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:b,pinned:"right",sectionRef:m,sort:d,width:h})]}))},cn=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},sn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=M(),f=d.columnResizing,h=d.editColumns,v=d.headers,p=i(null),g=v.filter(function(e){return!e.pinned}),m=v.filter(function(e){return"left"===e.pinned}),y=v.filter(function(e){return"right"===e.pinned}),b=a(function(){return cn({headers:m})},[m]),C=a(function(){return cn({headers:g})},[g]),S=a(function(){return cn({headers:y})},[y]),I={centerHeaderRef:p,headers:v,mainTemplateColumns:C,pinnedLeftColumns:m,pinnedLeftTemplateColumns:b,pinnedRightColumns:y,pinnedRightTemplateColumns:S,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},x={tableRows:s,mainTemplateColumns:C,pinnedLeftColumns:m,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:y,pinnedRightTemplateColumns:S,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",w({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(ln,w({},I)),e(He,w({},x))]}))},un=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=M().editColumns,v=o(!1),p=v[0],g=v[1],m=i(null),y=f.current&&f.current.scrollHeight>f.current.clientHeight,b=h?28:0,C=(h?d+1:d)+(f.current&&y?f.current.offsetWidth-f.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;g(l>e)}}()},1)},[s,l]),p?n("div",w({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=m.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Ne,w({childRef:m},{children:e("div",w({className:"st-horizontal-scrollbar-middle",ref:m,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=m.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},dn={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 dn.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?dn.string(e,n,t):"number"==typeof e&&"number"==typeof n?dn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?dn.boolean(e,n,t):dn.string(String(e),String(n),t)}},fn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return b([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return dn.number(i,a,r)}return"date"===t?dn.date(String(e),String(n),r):"boolean"===t?dn.boolean(Boolean(e),Boolean(n),r):"enum"===t?dn.enum(String(e),String(n),r):dn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},hn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return fn({rows:t,sortColumn:r,headers:n})},vn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):hn({headers:i,rows:t,sortColumn:r}):t},pn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(pn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},gn=function(e){return e.every(function(e){return e.hide})},wn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(wn(e.children),gn(e.children)&&(e.hide=!0))})},mn=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),f=d[0],h=d[1],v=M(),p=v.expandIcon,g=v.headers,m=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,S=null!=u?u:s.hide||C&&s.children&&gn(s.children);return n(t,{children:[n("div",w({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",w({className:"st-header-icon-container"},{children:C?e("div",w({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e(me,w({checked:S,onChange:function(e){(s.hide=e,e)?wn(i):(pn(i,s.accessor),C&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,pn(i,s.children[0].accessor)));m(b([],g,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",w({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(mn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!S||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},yn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",w({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",w({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(mn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},bn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,l=t.headers,c=t.position,s=void 0===c?"right":c,u=o(a),d=u[0],f=u[1];return i?n("div",w({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",w({className:"st-column-editor-text"},{children:r})),e(yn,{headers:l,open:d,position:s})]})):null},Cn=function(n){var t=n.className;return e("svg",w({"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"})}))},Sn=function(n){var t=n.className;return e("svg",w({"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"})}))},In=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),f=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(Re.Provider,w({value:{registerPane:d,unregisterPane:f}},{children:r.Children.only(t)}))},xn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=Oe[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)},Rn=function(){var t=M(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",w({className:"st-filter-bar"},{children:e("div",w({className:"st-filter-bar-content"},{children:e("div",w({className:"st-filter-chips"},{children:a.map(function(t){return n("div",w({className:"st-filter-chip"},{children:[e("span",w({className:"st-filter-chip-text"},{children:xn(t,i)})),e("button",w({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},En=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Nn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=En(h),g=En(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return En(new Date(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return En(new Date(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var S=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=S}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},kn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return Te(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&k(l)){var c=i(l,t+1),s=w({},n);return s[o]=c,e.forEach(function(e){var n=An(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},An=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&k(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Fn=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],f=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),h=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=f(e);g(e,!n)}},[f,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:f,areAllRowsSelected:h,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Hn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(Dn,w({},n)):null},Dn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.className,v=t.columnBorders,p=void 0!==v&&v,C=t.columnEditorPosition,S=void 0===C?"right":C,E=t.columnEditorText,N=void 0===E?"Columns":E,D=t.columnReordering,M=void 0!==D&&D,P=t.columnResizing,q=void 0!==P&&P,z=t.defaultHeaders,Y=t.editColumns,j=void 0!==Y&&Y,G=t.editColumnsInitOpen,K=void 0!==G&&G,U=t.enableHeaderEditing,V=void 0!==U&&U,J=t.enableRowSelection,X=void 0!==J&&J,_=t.expandAll,$=void 0===_||_,Q=t.expandIcon,ee=void 0===Q?e(L,{className:"st-expand-icon"}):Q,ne=t.externalFilterHandling,te=void 0!==ne&&ne,re=t.externalSortHandling,oe=void 0!==re&&re,ie=t.headerDropdown,ae=t.height,le=t.hideFooter,ce=void 0!==le&&le,se=t.nextIcon,de=void 0===se?e(L,{className:"st-next-prev-icon"}):se,fe=t.onCellEdit,he=t.onCellClick,ve=t.onColumnOrderChange,pe=t.onColumnSelect,ge=t.onFilterChange,we=t.onGridReady,me=t.onHeaderEdit,ye=t.onLoadMore,be=t.onNextPage,Ce=t.onRowSelectionChange,Se=t.onSortChange,Ie=t.prevIcon,xe=void 0===Ie?e(B,{className:"st-next-prev-icon"}):Ie,Re=t.rowButtons,Ee=t.rowGrouping,Ne=t.rowHeight,ke=void 0===Ne?32:Ne,Ae=t.rowIdAccessor,Fe=t.rows,He=t.selectionColumnWidth,De=void 0===He?42:He,Te=t.rowsPerPage,We=void 0===Te?10:Te,Be=t.selectableCells,Le=void 0!==Be&&Be,Oe=t.selectableColumns,Pe=void 0!==Oe&&Oe,qe=t.shouldPaginate,ze=void 0!==qe&&qe,Ye=t.sortDownIcon,je=void 0===Ye?e(Cn,{className:"st-header-icon"}):Ye,Ge=t.sortUpIcon,Ke=void 0===Ge?e(Sn,{className:"st-header-icon"}):Ge,Ue=t.tableRef,Ve=t.theme,Je=void 0===Ve?"light":Ve,Xe=t.useHoverRowBackground,_e=void 0===Xe||Xe,$e=t.useOddEvenRowBackground,Qe=void 0!==$e&&$e,Ze=t.useOddColumnBackground,en=void 0!==Ze&&Ze;en&&(Qe=!1),p&&(_e=!1);var nn=g(function(e){return e+1},0)[1],tn=i(null),rn=i(null),on=i(null),an=i(null),ln=i(null),cn=i(null),dn=i(null),fn=o(1),pn=fn[0],gn=fn[1],wn=o(z),mn=wn[0],yn=wn[1],xn=o(!1),En=xn[0],An=xn[1],Hn=o(!1),Dn=Hn[0],Tn=Hn[1],Mn=o(null),Wn=Mn[0],Bn=Mn[1];c(function(){yn(z)},[z]);var Ln=Fn({rows:Fe,rowIdAccessor:Ae,onRowSelectionChange:Ce,enableRowSelection:X}),On=Ln.selectedRows,Pn=Ln.setSelectedRows,qn=Ln.isRowSelected,zn=Ln.areAllRowsSelected,Yn=Ln.selectedRowCount,jn=Ln.selectedRowsData,Gn=Ln.handleRowSelect,Kn=Ln.handleSelectAll,Un=Ln.handleToggleRow,Vn=Ln.clearSelection,Jn=a(function(){var e,n=b([],mn,!0);X&&!(null===(e=null==mn?void 0:mn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=b([{accessor:"__row_selection__",label:"",width:De,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[X,mn,De]),Xn=o(0),_n=Xn[0],$n=Xn[1],Qn=o(new Set),Zn=Qn[0],et=Qn[1],nt=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:cn}),tt=nt.scrollbarWidth,rt=nt.setScrollbarWidth,ot=o(0),it=ot[0],at=ot[1];d(function(){var e=function(){cn.current&&at(cn.current.clientWidth)};e();var n=null;return cn.current&&(n=new ResizeObserver(e)).observe(cn.current),function(){n&&n.disconnect()}},[]);var lt=a(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=0,a=0,l=0;if(n.forEach(function(e){if(!e.hide){var n=x(e).reduce(function(e,n){return e+R(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:l+=n}}),t&&t>0){var c=t*o;i>c&&(i=c),a>c&&(a=c)}return{leftWidth:Me(i),rightWidth:Me(a),mainWidth:l}}({headers:Jn,containerWidth:it});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Jn,it]),ct=lt.mainBodyWidth,st=lt.pinnedLeftWidth,ut=lt.pinnedRightWidth,dt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-t)},[n,t])}({height:ae,rowHeight:ke}),ft=kn({rows:Fe,headers:mn,rowGrouping:Ee}),ht=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Nn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=w(w({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=w({},c);delete n[e],s(n),null==r||r(n)},[c,r]),h=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=w(w({},c),((r={})[e.accessor]=e,r));return Nn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:ft,externalFilterHandling:te,onFilterChange:ge}),vt=ht.filters,pt=ht.filteredRows,gt=ht.updateFilter,wt=ht.clearFilter,mt=ht.clearAllFilters,yt=ht.computeFilteredRowsPreview,bt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],f=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=hn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(k(a)){var l=f({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return w(w({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return vn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:f})},[t,u,n,r,c,f]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},vn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:f})},[u,n,t,r,c,f]);return{sort:u,sortedRows:h,updateSort:v,computeSortedRowsPreview:p}}({headers:mn,tableRows:pt,externalSortHandling:oe,onSortChange:Se,rowGrouping:Ee}),Ct=bt.sort,St=bt.sortedRows,It=bt.updateSort,xt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,f=e.rowGrouping,h=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,m=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,S=e.computeSortedRowsPreview,I=o(!1),x=I[0],R=I[1],E=o([]),N=E[0],k=E[1],H=i([]),D=i([]),T=i(new Map),M=i(null),W=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return f&&0!==f.length?F({rows:n,rowGrouping:f,rowIdAccessor:h,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,f,h,v,p]);a(function(){if(0===T.current.size){var e=W(r),n=new Map;e.forEach(function(e){var t=String(A({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),T.current=n}},[r,W,h]);var B=a(function(){return W(t)},[t,W]),L=a(function(){return O({bufferRowCount:5,contentHeight:g,tableRows:B,rowHeight:m,scrollTop:y})},[B,g,m,y]),P=l(function(e,n){var t=new Set(e.map(function(e){return String(A({row:e.row,rowIdAccessor:h}))})),r=new Set(n.map(function(e){return String(A({row:e.row,rowIdAccessor:h}))}));return{staying:n.filter(function(e){var n=String(A({row:e.row,rowIdAccessor:h}));return t.has(n)}),entering:n.filter(function(e){var n=String(A({row:e.row,rowIdAccessor:h}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(A({row:e.row,rowIdAccessor:h}));return!r.has(n)})}},[h]),q=a(function(){if(0===H.current.length)return!1;var e=B.map(function(e){return String(A({row:e.row,rowIdAccessor:h}))}),n=H.current.map(function(e){return String(A({row:e.row,rowIdAccessor:h}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[B,h]);d(function(){if(!x){if(!n||u)return k([]),H.current=B,void(D.current=L);if(0===H.current.length)return k([]),H.current=B,void(D.current=L);if(!q)return k([]),H.current=B,void(D.current=L);M.current={tableRows:B,visibleRows:L},R(!0)}},[n,B,q,x,u,L]),d(function(){if(x&&M.current&&N.length>0){var e=setTimeout(function(){var e=M.current;R(!1),k([]),H.current=e.tableRows,D.current=e.visibleRows,M.current=null},ue.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var z=a(function(){if(!n||u)return L;if(N.length>0){var e=new Map;return B.forEach(function(n){var t=String(A({row:n.row,rowIdAccessor:h}));e.set(t,n.position)}),N.map(function(n){var t=String(A({row:n.row,rowIdAccessor:h})),r=e.get(t);return void 0!==r?w(w({},n),{position:r}):n})}return L},[L,N,B,n,u,h]),Y=l(function(e){if(n&&!u){var t=C(e),r=W(t),o=O({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=P(L,o).entering.map(function(e){var n=String(A({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(A({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&k(b(b([],L,!0),i,!0))}},[n,u,C,W,g,m,y,P,B,L,h]),j=l(function(e){if(n&&!u){var t=S(e),r=W(t),o=O({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:m,scrollTop:y}),i=P(L,o).entering.map(function(e){var n=String(A({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(A({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&k(b(b([],L,!0),i,!0))}},[n,u,S,W,g,m,y,P,B,L,h]);return{currentTableRows:B,currentVisibleRows:L,isAnimating:x,prepareForFilterChange:Y,prepareForSortChange:j,rowsToRender:z}}({allowAnimations:s,sortedRows:St,originalRows:ft,currentPage:pn,rowsPerPage:We,shouldPaginate:ze,rowGrouping:Ee,rowIdAccessor:Ae,unexpandedRows:Zn,expandAll:$,contentHeight:dt,rowHeight:ke,scrollTop:_n,computeFilteredRowsPreview:yt,computeSortedRowsPreview:bt.computeSortedRowsPreview}),Rt=xt.currentTableRows,Et=xt.rowsToRender,Nt=xt.prepareForFilterChange,kt=xt.prepareForSortChange,At=xt.isAnimating,Ft=i(new Map),Ht=i(new Map),Dt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,f=o(new Set),h=f[0],v=f[1],p=o(new Set),g=p[0],w=p[1],b=o(null),C=b[0],S=b[1],I=o(null),R=I[0],E=I[1],N=o(new Set),k=N[0],F=N[1],D=o(new Set),T=D[0],M=D[1],W=i(!1),B=i(null),L=a(function(){var e=new Set;return h.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),g.forEach(function(n){e.add(n)}),e},[h,g]),O=a(function(){var e=new Set;return h.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),g.size>0&&r.forEach(function(n){var t=A({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[h,g,r,s]),P=a(function(){return t.flatMap(x)},[t]),q=l(function(){var e=P.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(h).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");h.size>0&&(navigator.clipboard.writeText(o),F(new Set(h)),setTimeout(function(){F(new Set)},800))},[P,h,r]),z=l(function(){return m(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return y(this,function(f){switch(f.label){case 0:if(!R)return[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=f.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=P.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var f=a+n,h=l+c;if(!(f>=r.length||h>=t.length)){var v=r[f],p=t[h],g=A({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:f});var S=H({colIndex:h,rowIndex:f,rowId:g});o.add(S)}else{var I=H({colIndex:h,rowIndex:f,rowId:g});i.add(I)}}})}),o.size>0&&(F(o),setTimeout(function(){F(new Set)},800)),i.size>0&&(M(i),setTimeout(function(){M(new Set)},800)),[3,4]):[2];case 3:return c=f.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,P,r,s,u,d]),Y=l(function(){if(0!==h.size){var e=P.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(h).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],f=e[l],h=A({row:c.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(c.row[f.accessor])?[]:""),c.row[f.accessor]=v,d){var p="".concat(h,"-").concat(f.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:f.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(F(t),setTimeout(function(){F(new Set)},800)),o.size>0&&(M(o),setTimeout(function(){M(new Set)},800))}},[h,P,r,s,u,d]),j=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=A({row:r[c].row,rowIdAccessor:s});t.add(H({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),S(null),v(t)},[r,s,w,S,v]),G=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<P.length){var n=H(e);w(new Set),S(null),v(new Set([n])),E(e)}},[P.length,r.length,w,S,v,E]),K=l(function(e,n){void 0===n&&(n=!1),v(new Set),E(null),w(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&S(e[e.length-1])},[v,E,w,S]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void z();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(A({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return A({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=A({row:r[o-1].row,rowIdAccessor:s});G({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=A({row:r[o+1].row,rowIdAccessor:s}),G({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=A({row:r[o].row,rowIdAccessor:s}),G({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<P.length-1&&(c=A({row:r[o].row,rowIdAccessor:s}),G({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),w(new Set),S(null),B.current=null,E(null))}else q()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[q,P.length,R,s,j,G,n,r,z,Y]);var U=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=H({colIndex:n,rowIndex:t,rowId:r}),i=h.has(o),a=g.has(n);return i||a},[h,g]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?A({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?A({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},f={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!U(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!U(u)||g.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),U(d)||i.push("st-selected-left-border"),U(f)||i.push("st-selected-right-border"),i.join(" ")},[U,r,g,s]),J=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),X=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=H({colIndex:n,rowIndex:t,rowId:r});return k.has(o)},[k]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=H({colIndex:n,rowIndex:t,rowId:r});return T.has(o)},[T]);return{getBorderClass:V,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(W.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){w(new Set),S(null);var e=H({colIndex:t,rowIndex:r,rowId:o});v(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&W.current&&B.current){for(var i=new Set,a=Math.min(B.current.rowIndex,o),l=Math.max(B.current.rowIndex,o),c=Math.min(B.current.colIndex,t),u=Math.max(B.current.colIndex,t),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<r.length){var h=A({row:r[d].row,rowIdAccessor:s});i.add(H({colIndex:f,rowIndex:d,rowId:h}))}v(i)}},handleMouseUp:function(){W.current=!1},isCopyFlashing:X,isWarningFlashing:_,isInitialFocusedCell:J,isSelected:U,lastSelectedColumnIndex:C,pasteFromClipboard:z,selectColumns:K,selectedCells:h,selectedColumns:g,setInitialFocusedCell:E,setSelectedCells:v,setSelectedColumns:w,deleteSelectedCells:Y,columnsWithSelectedCells:L,rowsWithSelectedCells:O}}({selectableCells:Le,headers:mn,tableRows:Rt,rowIdAccessor:Ae,onCellEdit:fe,cellRegistry:Ft.current}),Tt=Dt.getBorderClass,Mt=Dt.handleMouseDown,Wt=Dt.handleMouseOver,Bt=Dt.handleMouseUp,Lt=Dt.isCopyFlashing,Ot=Dt.isInitialFocusedCell,Pt=Dt.isSelected,qt=Dt.isWarningFlashing,zt=Dt.selectColumns,Yt=Dt.selectedCells,jt=Dt.selectedColumns,Gt=Dt.setInitialFocusedCell,Kt=Dt.setSelectedCells,Ut=Dt.setSelectedColumns,Vt=Dt.columnsWithSelectedCells,Jt=Dt.rowsWithSelectedCells,Xt=l(function(e){kt(e),setTimeout(function(){It(e)},0)},[kt,It]),_t=l(function(e){yn(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Pe,selectedCells:Yt,selectedColumns:jt,setSelectedCells:Kt,setSelectedColumns:Ut,activeHeaderDropdown:Wn,setActiveHeaderDropdown:Bn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:nn,tableBodyContainerRef:cn,setScrollbarWidth:rt}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:we}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef,i=e.headerRegistryRef;c(function(){n&&(n.current={updateData:function(e){var n=e.accessor,i=e.rowIndex,a=e.newValue,l=null==t?void 0:t[i];if(l){var c=A({row:l,rowIdAccessor:r}),s=I({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=i.current.get(String(n));t&&t.setEditing(!0)}})},[o,i,t,r,n])}({cellRegistryRef:Ft,headerRegistryRef:Ht,rowIdAccessor:Ae,rows:Fe,tableRef:Ue}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:vt,onFilterChange:ge}),function(e){var n=e.sort,t=e.onSortChange,r=Z(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Ct,onSortChange:Se});var $t=l(function(e){Nt(e),setTimeout(function(){gt(e)},0)},[Nt,gt]);return e(T,w({value:{allowAnimations:s,areAllRowsSelected:zn,cellRegistry:Ft.current,cellUpdateFlash:f,clearSelection:Vn,columnBorders:p,columnReordering:M,columnResizing:q,draggedHeaderRef:tn,editColumns:j,enableHeaderEditing:V,enableRowSelection:X,expandIcon:ee,filters:vt,forceUpdate:nn,getBorderClass:Tt,handleApplyFilter:$t,handleClearAllFilters:mt,handleClearFilter:wt,handleMouseDown:Mt,handleMouseOver:Wt,handleRowSelect:Gn,handleSelectAll:Kn,handleToggleRow:Un,headerContainerRef:dn,headerRegistry:Ht.current,headers:Jn,hoveredHeaderRef:rn,isAnimating:At,isCopyFlashing:Lt,isInitialFocusedCell:Ot,isResizing:En,isRowSelected:qn,isScrolling:Dn,isSelected:Pt,isWarningFlashing:qt,mainBodyRef:on,nextIcon:de,onCellEdit:fe,onCellClick:he,onColumnOrderChange:ve,onColumnSelect:pe,onLoadMore:ye,onSort:Xt,onTableHeaderDragEnd:_t,pinnedLeftRef:an,pinnedRightRef:ln,prevIcon:xe,rowButtons:Re,rowGrouping:Ee,rowHeight:ke,rowIdAccessor:Ae,scrollbarWidth:tt,selectColumns:zt,selectableColumns:Pe,selectedColumns:jt,columnsWithSelectedCells:Vt,rowsWithSelectedCells:Jt,selectedRows:On,selectedRowCount:Yn,selectedRowsData:jn,setHeaders:yn,setInitialFocusedCell:Gt,setIsResizing:An,setIsScrolling:Tn,setSelectedCells:Kt,setSelectedColumns:Ut,setSelectedRows:Pn,setUnexpandedRows:et,shouldPaginate:ze,sortDownIcon:je,sortUpIcon:Ke,tableBodyContainerRef:cn,tableRows:Rt,theme:Je,unexpandedRows:Zn,useHoverRowBackground:_e,useOddColumnBackground:en,useOddEvenRowBackground:Qe,headerDropdown:ie,activeHeaderDropdown:Wn,setActiveHeaderDropdown:Bn,onHeaderEdit:me}},{children:e("div",w({className:"simple-table-root st-wrapper theme-".concat(Je," ").concat(null!=h?h:""," ").concat(p?"st-column-borders":""),style:ae?{height:ae}:{}},{children:e(In,{children:n("div",w({className:"st-wrapper-container"},{children:[e(Rn,{}),n("div",w({className:"st-content-wrapper",onMouseUp:Bt,onMouseLeave:Bt},{children:[e(sn,{pinnedLeftWidth:st,pinnedRightWidth:ut,setScrollTop:$n,sort:Ct,tableRows:Rt,rowsToRender:Et}),e(bn,{columnEditorText:N,editColumns:j,editColumnsInitOpen:K,headers:mn,position:S})]})),e(un,{mainBodyRef:on,mainBodyWidth:ct,pinnedLeftWidth:st,pinnedRightWidth:ut,tableBodyContainerRef:cn}),e(W,{currentPage:pn,hideFooter:ce,onPageChange:gn,onNextPage:be,shouldPaginate:ze,totalPages:Math.ceil(St.length/We)})]}))})}))}))};export{Hn as SimpleTable};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(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 l=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},d=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return d(e)}):[e]},f=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(l({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){f(e)})},h=function(e){return"number"==typeof e.minWidth?e.minWidth:40},v=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},p=function(e){return e.row[e.rowIdAccessor]},g=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=p({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var g=String(c);if((o?!i.has(g):i.has(g))&&n<s.length){var m=function(e,n){var t=e[n];return v(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},m=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},w=n.createContext(void 0),x=function(n){var t=n.children,r=n.value;return e.jsx(w.Provider,o({value:r},{children:t}))},y=function(){var e=n.useContext(w);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},b=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=y(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)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 e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),b.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},C=function(n){var t=n.className;return e.jsx("svg",o({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},S=function(n){var t=n.className;return e.jsx("svg",o({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},I=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},R=function(e){return e.position*(e.rowHeight+1)-1},j=function(e){return e.position*(e.rowHeight+1)},E=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=y().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],b=n.useState({}),C=b[0],S=b[1],I=n.useState(!1),R=I[0],j=I[1];return n.useEffect(function(){a&&p.current?(j(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),S(l),j(!0)}})):a||j(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,i,c]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(c(!1),null==i||i())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i,a,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[i,a,c]),a?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:R?"visible":"hidden"},C),{overflow:l})},{children:r})):null},k=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},N=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(E,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(k,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(k,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},F=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},A=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},M=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=y(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===g&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return m("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=i===new Date(l).getDate()&&r===new Date(l).getMonth()&&t===new Date(l).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth(),e);v(n),a(n),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)p(g);var m=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=m;g++)x(g);return n}(),"months"===g&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var i=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&function(){for(var n=[],t=h.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),m("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),a(e),null==s||s()}},{children:"Today"}))}))]}))},H=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},D=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(E,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(M,{value:H(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},T=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(E,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(k,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},L=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(N,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(D,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(T,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(A,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(F,{defaultValue:d,onBlur:c,onChange:o})},B=0,W=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===B||o-B>=r)&&(B=o,n(t))}},O=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},P=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(P);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=P(e[t]));return n},q=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},z=Date.now(),Y={screenX:0,screenY:0},G=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 s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=G(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},K=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function U(e,n,t){var r,i,a=P(e),s=!1;try{var l=K(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var V=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=y().setHeaders,l=O(t);return{handleDragStart:function(e){n.current=e,z=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-Y.screenX,2)+Math.pow(u-Y.screenY,2));r.current=a;var f,h=n.current,v=!1;if(K(h)!==K(a)){f=(C=U(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=G(p,h.accessor),m=G(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,y=m;if(w!==x){var b=x-w;b>0&&(y=m.slice(0,-b))}var C=function(e,n,t){var r=P(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 s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,g,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-z<1500||d<40)||(z=S,Y={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},J=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},X={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},_={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},$={duration:150,easing:"ease-out",delay:0},Q=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Z=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){Q(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ee=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:J()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),J()?o(o({},$),e):o(o({},"column"===n?X:_),e)}(t,i?"column":"row"),Q(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Z(n,l,t)]);case 1:return a.sent(),[2]}})})},ne=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,g,m,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,J()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},te=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(t,["children","id","parentRef","tableRow"]),c=y(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=O(f),m=O(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},_),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),y=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,b=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==y&&void 0!==b&&void 0!==C){var S=5*h,I=y-S,R=y+b+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<y,N=i.y>y+b,F=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var H=y+b+M(i.y,y,y+b)+F%15*A*2.5+F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){H=y-M(i.y,y,y+b)-F%15*A*2.5-F%7*(.4*h);return void ne({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var D=y+b+M(l.y,y,y+b)+F%10*A*1;return void ne({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){D=y-M(l.y,y,y+b)-F%10*A*1;return void ne({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ee({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};te.displayName="Animate";var re=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},oe=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(re,{className:"st-checkbox-checkmark"})})),i]}))},ie=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ae=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,c=t.isInitialFocused,d=t.nestedIndex,f=t.rowIndex,h=t.tableRow,g=y(),m=g.cellRegistry,w=g.cellUpdateFlash,x=g.columnBorders,b=g.draggedHeaderRef,C=g.enableRowSelection,S=g.expandIcon,I=g.handleMouseDown,R=g.handleMouseOver,j=g.handleRowSelect,E=g.headers,k=g.hoveredHeaderRef,N=g.isCopyFlashing,F=g.isRowSelected,A=g.isWarningFlashing,M=g.onCellEdit,H=g.onCellClick,D=g.onTableHeaderDragEnd,T=g.rowButtons,B=g.rowGrouping,O=g.rowIdAccessor,P=g.rowsWithSelectedCells,q=g.selectedColumns,z=g.setUnexpandedRows,Y=g.tableBodyContainerRef,G=g.theme,K=g.unexpandedRows,U=g.useOddColumnBackground,J=h.depth,X=h.row,_=n.useState(X[a.accessor]),$=_[0],Q=_[1],Z=n.useState(!1),ee=Z[0],ne=Z[1],re=n.useState(!1),ae=re[0],se=re[1],le=n.useState(!1),ce=le[0],ue=le[1],de=n.useRef(null),fe=p({row:X,rowIdAccessor:O}),he=B&&B[J],ve=!!he&&function(e,n){if(!n)return!1;var t=e[n];return v(t)}(X,he),pe=!K.has(String(fe)),ge=N({rowIndex:f,colIndex:i,rowId:fe}),me=A({rowIndex:f,colIndex:i,rowId:fe}),we=n.useMemo(function(){var e,n,t;if(!x)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[x,E,a.accessor,a.pinned]),xe=V({draggedHeaderRef:b,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:D}).handleDragOver,ye=W(),be=l({accessor:a.accessor,rowId:fe}),Ce=u({rowId:fe,accessor:a.accessor}),Se=a.isSelectionColumn&&C;n.useEffect(function(){if(m){var e="".concat(fe,"-").concat(a.accessor);return m.set(e,{updateContent:function(e){$!==e?(Q(e),w&&(se(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(function(){se(!1)},800))):Q(e)}}),function(){m.delete(e),de.current&&clearTimeout(de.current)}}},[m,w,fe,a.accessor,$]),n.useEffect(function(){if(ae){var e=setTimeout(function(){se(!1)},850);return function(){return clearTimeout(e)}}},[ae]),n.useEffect(function(){Q(X[a.accessor])},[X,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=q.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&P.has(String(fe))},[Se,P,fe]),Ne="st-cell ".concat(J>0&&a.expandable?"st-cell-depth-".concat(J):""," ").concat(Ee?c?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?c?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(ae?c?"st-cell-updating-first":"st-cell-updating":""," ").concat(ge?c?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(me?c?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(U?d%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),Fe=n.useCallback(function(e){Q(e),X[a.accessor]=e,null==M||M({accessor:a.accessor,newValue:e,row:X,rowIndex:f})},[a.accessor,M,X,f]),Ae=n.useCallback(function(){z(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,z]);return!ee||Ie||Se?e.jsxs(te,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":fe,"data-row-index":f,id:be,onClick:function(){H&&!Se&&H({accessor:a.accessor,colIndex:i,row:X,rowId:fe,rowIndex:f,value:$})},onDoubleClick:function(){return a.isEditable&&!Se&&ne(!0)},onDragOver:function(e){Se||ye({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ee||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ee||(e.preventDefault(),ne(!0))},onMouseDown:function(){ee||Se||I({rowIndex:f,colIndex:i,rowId:fe})},onMouseEnter:function(){ue(!0)},onMouseLeave:function(){ue(!1)},onMouseOver:function(){ee||Se||R({rowIndex:f,colIndex:i,rowId:fe})},parentRef:Y,tableRow:h},{children:[a.expandable&&ve?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Ae},{children:S})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ce||F&&F(String(fe))?e.jsx(oe,{checked:!!F&&F(String(fe)),onChange:function(e){j&&j(String(fe),e)}}):e.jsx("span",o({className:"st-row-number"},{children:f+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ce||F&&F(String(fe))))return null;var n={row:X};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:X,theme:G}):ie({content:$,header:a})})})),ee&&Ie&&!Se&&e.jsx(L,{enumOptions:a.enumOptions,onChange:Fe,setIsEditing:ne,type:a.type,value:$})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:l({accessor:a.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(L,{enumOptions:a.enumOptions,onChange:Fe,setIsEditing:ne,type:a.type,value:$})}))},se=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,u=n.tableRow,d=y().rowIdAccessor,f=o.filter(function(e){return c({header:e,pinned:i})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var f=p({row:u.row,rowIdAccessor:d}),h=l({accessor:n.accessor,rowId:f});return e.jsx(le,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:u},h)})})},le=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.tableRow,h=r[o.accessor],v=y(),g=v.getBorderClass,m=v.isSelected,w=v.isInitialFocusedCell,x=v.rowIdAccessor,b=p({row:f.row,rowIdAccessor:x});if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:s})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=l({accessor:n.accessor,rowId:b});return e.jsx(le,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:u,rowIndices:d,tableRow:f},t)})})}var S={rowIndex:u,colIndex:h,rowId:b},I=g(S),R=m(S),j=w(S),E=l({accessor:o.accessor,rowId:b});return e.jsx(ae,{borderClass:I,colIndex:h,header:o,isHighlighted:R,isInitialFocused:j,nestedIndex:a,rowIndex:u,tableRow:f},E)},ce=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.hoveredIndex,l=n.index,c=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,h=n.tableRow,v=y(),g=v.useHoverRowBackground,m=v.rowIdAccessor,w=v.isAnimating,x=v.isRowSelected,b=v.useOddEvenRowBackground,C=h.position,S=C%2==0,I=p({row:h.row,rowIdAccessor:m}),R=!!x&&x(String(I));return e.jsx("div",o({className:"st-row ".concat(b?S?"even":"odd":""," ").concat(s===l&&g?"hovered":""," ").concat(R?"selected":""),onMouseEnter:function(){w||f(l)},style:{gridTemplateColumns:i,top:j({position:C,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(se,{columnIndexStart:r,columnIndices:t,headers:a,pinned:c,rowIndex:C,rowIndices:d,tableRow:h},I)}))},ue=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:R({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},de=n.createContext(void 0),fe=["default"],he=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(de);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),i=o.registerPane,a=o.unregisterPane;return n.useEffect(function(){return t.current&&i(t.current,fe),function(){t.current&&a(t.current,fe)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},ve=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},pe=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.hoveredIndex,c=t.pinned,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,g=t.rowsToRender,m=t.width,w=c?"st-body-pinned-".concat(c):"st-body-main",x=y().rowIdAccessor,b=n.useRef(null);return n.useImperativeHandle(r,function(){return b.current},[]),n.useMemo(function(){return q(s,c)},[s,c])?e.jsx(ve,o({condition:!c,wrapper:function(n){return e.jsx(he,o({childRef:b},{children:n}))}},{children:e.jsx("div",o({className:w,ref:b,style:o({position:"relative",height:"".concat(v,"px"),width:m},!c&&{flexGrow:1})},{children:g.map(function(t,r){var o=p({row:t.row,rowIdAccessor:x});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(ue,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:r-1}),e.jsx(ce,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:h,headers:s,hoveredIndex:l,index:r,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},o)]},o)})}))})):null});function ge(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}pe.displayName="TableSection";var me=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=y(),g=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,b=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,R=v.setIsScrolling,j=v.shouldPaginate,E=v.tableBodyContainerRef,k=n.useState(null),N=k[0],F=k[1],A=n.useState(!1),M=A[0],H=A[1];n.useEffect(function(){w&&null!==N&&F(null)},[w,N]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=i[1];n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:g,mainSectionRef:E,scrollbarWidth:I}),n.useEffect(function(){return function(){T.current&&clearTimeout(T.current)}},[]);var D=n.useRef(null),T=n.useRef(null),L=n.useRef(0),B=function(e){return e.length}(h),W=B*(C+1)-1,O=n.useMemo(function(){return ge({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l})},[m,i,l]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(p({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),q=n.useCallback(function(e,n){if(b&&!j&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>L.current&&(H(!0),b(),setTimeout(function(){H(!1)},1e3))}},[b,j,M]),z={columnIndices:O,headerContainerRef:g,headers:m,hoveredIndex:N,rowHeight:C,rowIndices:P,rowsToRender:d,setHoveredIndex:F};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(function(){R(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){f(t),q(n,t),L.current=t})},ref:E},{children:[e.jsx(pe,o({},z,{pinned:"left",templateColumns:a,totalHeight:W,width:s})),e.jsx(pe,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:W})),e.jsx(pe,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:W,width:u}))]}))},we=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 s=a[i];o=r(s,o)}return o};return r(e,n),t},xe=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,xe(e.children)),n})},ye=function(e){return void 0===e&&(e=0),e?e+1:0},be=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,v="touches"in n;if(o&&!o.hide){l(!0);var p=h(o),g=t-r>1,m=g?d(o):[o],w=function(e){var n="right"===o.pinned?u-e:e-u;if(g&&m.length>1)Ce({delta:n,leafHeaders:m,minWidth:p,startWidth:c});else{var t=Math.max(c+n,p);o.width=t}i.forEach(function(e){f(e)});var r=s([],i,!0);a(r)};if(v){var x=function(e){var n=e.touches[0];w(n.clientX)},y=function(){document.removeEventListener("touchmove",x),document.removeEventListener("touchend",y),l(!1)};document.addEventListener("touchmove",x),document.addEventListener("touchend",y)}else{var b=function(e){w(e.clientX)},C=function(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C),l(!1)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",C)}}},Ce=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=t.reduce(function(e,n){return Math.min(e,h(n))},40),a=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),s=Math.max(o+n,i)-a;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=s*(n/a),o=Math.max(n+t,r);e.width=o})},Se=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(l({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150}(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?r+=n:o+=n}}),{leftWidth:ye(t),rightWidth:ye(r),mainWidth:o}},Ie=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Re={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},je=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ee=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},ke=function(e){return["between","notBetween","in","notIn"].includes(e)},Ne=function(e){return["isEmpty","isNotEmpty"].includes(e)},Fe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},Ae=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Me=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],g=n.useState(-1),m=g[0],w=g[1],x=n.useRef(null),y=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),m>=0&&(i(a[m].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,m,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:y?y.label:l})),e.jsx(Ae,{})]})),e.jsx(E,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===m?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),n.value)})}))}))]}))},He=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:Re[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Me,{value:t,onChange:function(e){r(e)},options:i})}))},De=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Te=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},Le=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Be=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=je("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},Ee(c)&&{value:f});a(e)},g=Ne(c)||f.trim();return e.jsxs(Fe,{children:[e.jsx(He,{value:c,onChange:u,operators:v}),Ee(c)&&e.jsx(Te,{children:e.jsx(De,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(Le,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},We=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),g=p[0],m=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],y=w[1],b=je("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),m(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};Ee(u)?e.value=parseFloat(h):ke(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Fe,{children:[e.jsx(He,{value:u,onChange:d,operators:b}),Ee(u)&&e.jsx(Te,{children:e.jsx(De,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),ke(u)&&e.jsxs(Te,{children:[e.jsx(De,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(De,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(Le,{onApply:C,onClear:l,canApply:!!Ne(u)||(Ee(u)?""!==h.trim():!!ke(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},Oe=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Me,{value:t,onChange:r,options:o,className:a,placeholder:s})},Pe=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=je("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=Ne(l)||""!==d;return e.jsxs(Fe,{children:[e.jsx(He,{value:l,onChange:c,operators:h}),Ee(l)&&e.jsx(Te,{children:e.jsx(Oe,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(Le,{onApply:function(){var e={accessor:r.accessor,operator:l};Ee(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},qe=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),y=x[0],b=x[1],C=je("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),b(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=new Date(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var g=r?new Date(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(E,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(M,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Fe,{children:[e.jsx(He,{value:d,onChange:f,operators:C}),Ee(d)&&e.jsx(Te,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),ke(d)&&e.jsxs(Te,{children:[e.jsx(S,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(Le,{onApply:function(){var e={accessor:a.accessor,operator:d};Ee(d)?e.value=v:ke(d)&&(e.values=[m,y]),l(e)},onClear:c,canApply:!!Ne(d)||(Ee(d)?""!==v.trim():!!ke(d)&&""!==m.trim()&&""!==y.trim()),showClear:!!s})]})},ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1];n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var v=f.length===u.length;return e.jsxs(Fe,{children:[e.jsx(Te,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(oe,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(oe,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e.jsx(Le,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ye=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(We,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Pe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(ze,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Be,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ge=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,h=t.header,v=t.reverse,p=t.sort,g=n.useState(!1),m=g[0],w=g[1],x=n.useState(!1),b=x[0],C=x[1],S=n.useState(h.label||""),I=S[0],R=S[1],j=y(),k=j.activeHeaderDropdown,N=j.areAllRowsSelected,A=j.columnBorders,M=j.columnReordering,H=j.columnResizing,D=j.columnsWithSelectedCells,T=j.draggedHeaderRef,L=j.enableHeaderEditing,B=j.enableRowSelection,O=j.filters,P=j.handleApplyFilter,q=j.handleClearFilter,z=j.handleSelectAll,Y=j.headerDropdown,G=j.headerRegistry,K=j.headers,U=j.hoveredHeaderRef,J=j.onColumnOrderChange,X=j.onColumnSelect,_=j.onHeaderEdit,$=j.onSort,Q=j.onTableHeaderDragEnd,Z=j.rowHeight,ee=j.selectColumns,ne=j.selectableColumns,re=j.selectedColumns,ie=j.setActiveHeaderDropdown,ae=j.setHeaders,se=j.setInitialFocusedCell,le=j.setIsResizing,ce=j.setSelectedCells,ue=j.setSelectedColumns,de=j.sortDownIcon,fe=j.sortUpIcon,he=Boolean(null==h?void 0:h.isSortable),ve=Boolean(null==h?void 0:h.filterable),pe=O[h.accessor],ge=(null==k?void 0:k.accessor)===h.accessor,me=h.isSelectionColumn&&B,xe=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:ge,estimatedHeight:200,estimatedWidth:250,margin:4}),ye=xe.triggerRef,Ce=xe.position,Se=n.useMemo(function(){var e,n,t;if(!A)return!1;var r=K.filter(function(e){return"left"===e.pinned}),o=K.filter(function(e){return!e.pinned}),i=K.filter(function(e){return"right"===e.pinned});return"left"===h.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===h.accessor:"right"===h.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===h.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===h.accessor},[A,K,h.accessor,h.pinned]),Re=n.useMemo(function(){return!(!ne||me)&&we(h,a).some(function(e){return re.has(e)})},[ne,me,h,a,re]),je=n.useMemo(function(){return!me&&D.has(a)},[me,D,a]),Ee="st-header-cell ".concat(h.accessor===(null===(r=U.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=T.current)||void 0===i?void 0:i.accessor)===h.accessor?"st-dragging":""," ").concat(he?"clickable":""," ").concat(M&&!he?"columnReordering":""," ").concat(h.children?"parent":""," ").concat(Se?"st-last-column":""," ").concat(L&&!me?"st-header-editable":""," ").concat(Re?"st-header-selected":""," ").concat(je&&!Re?"st-header-has-highlighted-cell":""),ke=V({draggedHeaderRef:T,headers:K,hoveredHeaderRef:U,onColumnOrderChange:J,onTableHeaderDragEnd:Q}),Ne=ke.handleDragStart,Fe=ke.handleDragEnd,Ae=ke.handleDragOver,Me=W();n.useEffect(function(){if(G&&!h.isSelectionColumn){var e=String(h.accessor);return G.set(e,{setEditing:function(e){C(e)}}),function(){G.delete(e)}}},[G,h.accessor,h.isSelectionColumn]),n.useEffect(function(){R(h.label||"")},[h.label]);var He=n.useCallback(function(e){R(e);var n=K.map(function(n){return n.accessor===h.accessor?o(o({},n),{label:e}):n});ae(n),_&&_(h,e)},[K,ae,_,h]);n.useCallback(function(){ie&&ie(ge?null:h)},[ie,ge,h]);var De=n.useCallback(function(){ie&&ie(null)},[ie]),Te=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ne){var r=we(t,a),o=r.some(function(e){return re.has(e)});if(L&&o&&!n.shiftKey)return Y&&ge&&De(),void C(!0);n.shiftKey&&ee?ue(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,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):ee&&ee(r),ce(new Set),se(null)}X&&X(t),!ne&&t.isSortable&&$(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!h)return null;var Le=H&&!me&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Me({callback:be,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:h,headers:K,setHeaders:ae,setIsResizing:le,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Me({callback:be,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:h,headers:K,setHeaders:ae,setIsResizing:le,startWidth:t},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Be=p&&p.key.accessor===h.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Te({event:e,header:h})}},{children:["ascending"===p.direction&&fe&&fe,"descending"===p.direction&&de&&de]})),We=ve&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),w(!m)}},{children:[e.jsx(Ie,{className:"st-header-icon",style:{fill:pe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(E,o({open:m,overflow:"visible",setOpen:w,onClose:function(){return w(!1)}},{children:e.jsx(Ye,{header:h,currentFilter:pe,onApplyFilter:function(e){P(e),w(!1)},onClearFilter:function(){q(h.accessor),w(!1)}})}))]}));return e.jsxs(te,o({className:Ee,id:l({accessor:h.accessor,rowId:"header"}),onDragOver:function(e){me||Me({callback:Ae,callbackProps:{event:e,hoveredHeader:h},limit:50})},style:o(o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},c-u>1?{}:{width:h.width}),d-f>1?{}:{height:Z})},{children:[v&&Le,"right"===h.align&&We,"right"===h.align&&Be,e.jsx("div",o({ref:ye,className:"st-header-label",draggable:M&&!h.disableReorder&&!me,onClick:function(e){me||Te({event:e,header:h})},onDoubleClick:function(e){me||function(e){e.event;var n=e.header;n.isSelectionColumn||ne&&n.isSortable&&$(n.accessor)}({event:e,header:h})},onDragEnd:me?void 0:function(e){e.preventDefault(),Fe()},onDragStart:me?void 0:function(e){M&&h&&function(e){Ne(e)}(h)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:me?e.jsx(oe,{checked:!!N&&N(),onChange:function(e){z&&z(e)}}):b?e.jsx(F,{defaultValue:I,onBlur:function(){return C(!1)},onChange:He}):h.headerRenderer?h.headerRenderer({accessor:h.accessor,colIndex:a,header:h}):I||(null==h?void 0:h.label)}))})),"right"!==h.align&&Be,"right"!==h.align&&We,!v&&Le,Y&&!me&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:Y({accessor:h.accessor,colIndex:a,header:h,isOpen:ge,onClose:De,position:Ce})}))]}))},Ke=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var s,d;if(void 0===a&&(a=!1),!c({header:o,pinned:u}))return 0;a||n++;var f=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=i,g=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:g,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,i+1,m),m=!1)})}return v-h},o=s.filter(function(e){return c({header:e,pinned:u})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,u,r]);return e.jsx(ve,o({condition:!u,wrapper:function(n){return e.jsx(he,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:d,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ge,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===u,sort:f},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},Ve=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,s=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=y(),g=p.headerContainerRef,m=p.pinnedLeftRef,w=p.pinnedRightRef,x=n.useMemo(function(){return ge({headers:i,pinnedLeftColumns:s,pinnedRightColumns:u})},[i,s,u]),b=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=Ue(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[q(i,"left")&&e.jsx(Ke,{columnIndices:x,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:b,pinned:"left",sectionRef:m,sort:f,width:h}),e.jsx(Ke,{columnIndices:x,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:b,sectionRef:r,sort:f}),q(i,"right")&&e.jsx(Ke,{columnIndices:x,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:b,pinned:"right",sectionRef:w,sort:f,width:v})]}))},Je=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},Xe=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=y(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),m=h.filter(function(e){return"right"===e.pinned}),w=n.useMemo(function(){return Je({headers:g})},[g]),x=n.useMemo(function(){return Je({headers:p})},[p]),b=n.useMemo(function(){return Je({headers:m})},[m]),C={centerHeaderRef:v,headers:h,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedRightColumns:m,pinnedRightTemplateColumns:b,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedLeftWidth:r,pinnedRightColumns:m,pinnedRightTemplateColumns:b,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Ve,o({},C)),e.jsx(me,o({},S))]}))},_e=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=y().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=u.current&&u.current.scrollHeight>u.current.clientHeight,m=d?28:0,w=(d?c+1:c)+(u.current&&g?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;v(a>e)}}()},1)},[s,a]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:l,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx(he,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}}),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},$e={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 $e.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?$e.string(e,n,t):"number"==typeof e&&"number"==typeof n?$e.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?$e.boolean(e,n,t):$e.string(String(e),String(n),t)}},Qe=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return $e.number(i,a,r)}return"date"===t?$e.date(String(e),String(n),r):"boolean"===t?$e.boolean(Boolean(e),Boolean(n),r):"enum"===t?$e.enum(String(e),String(n),r):$e.string(String(e),String(n),r)}(e[r],n[r],a,l)})},Ze=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return Qe({rows:t,sortColumn:r,headers:n})},en=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):Ze({headers:i,rows:t,sortColumn:r}):t},nn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(nn([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},tn=function(e){return e.every(function(e){return e.hide})},rn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(rn(e.children),tn(e.children)&&(e.hide=!0))})},on=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=y(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,b=null!=u?u:c.hide||x&&c.children&&tn(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(oe,o({checked:b,onChange:function(e){(c.hide=e,e)?rn(r):(nn(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,nn(r,c.children[0].accessor)));m(s([],g,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(on,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},an=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(on,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},sn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(an,{headers:s,open:d,position:c})]})):null},ln=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},cn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},un=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(de.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},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=Re[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)},fn=function(){var n=y(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:dn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},hn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},vn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=hn(h),g=hn(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return hn(new Date(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return hn(new Date(String(e||"")))});return w=y[0],x=y[1],p<w||p>x}return!0}}if("boolean"==typeof e){var b=Boolean(r);if("equals"===t)return e===b}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},pn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return xe(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&v(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=gn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},gn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&v(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},mn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),g=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:g,clearSelection:m}},wn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,f=void 0!==c&&c,h=t.className,w=t.columnBorders,y=void 0!==w&&w,R=t.columnEditorPosition,j=void 0===R?"right":R,E=t.columnEditorText,k=void 0===E?"Columns":E,N=t.columnReordering,F=void 0!==N&&N,A=t.columnResizing,M=void 0!==A&&A,H=t.defaultHeaders,D=t.editColumns,T=void 0!==D&&D,L=t.editColumnsInitOpen,B=void 0!==L&&L,W=t.enableHeaderEditing,P=void 0!==W&&W,q=t.enableRowSelection,z=void 0!==q&&q,Y=t.expandAll,G=void 0===Y||Y,K=t.expandIcon,U=void 0===K?e.jsx(S,{className:"st-expand-icon"}):K,V=t.externalFilterHandling,J=void 0!==V&&V,X=t.externalSortHandling,$=void 0!==X&&X,Q=t.headerDropdown,Z=t.height,ee=t.hideFooter,ne=void 0!==ee&&ee,te=t.nextIcon,re=void 0===te?e.jsx(S,{className:"st-next-prev-icon"}):te,oe=t.onCellEdit,ie=t.onCellClick,ae=t.onColumnOrderChange,se=t.onColumnSelect,le=t.onFilterChange,ce=t.onGridReady,ue=t.onHeaderEdit,de=t.onLoadMore,fe=t.onNextPage,he=t.onRowSelectionChange,ve=t.onSortChange,pe=t.prevIcon,ge=void 0===pe?e.jsx(C,{className:"st-next-prev-icon"}):pe,me=t.rowButtons,we=t.rowGrouping,xe=t.rowHeight,ye=void 0===xe?32:xe,be=t.rowIdAccessor,Ce=t.rows,Ie=t.selectionColumnWidth,Re=void 0===Ie?42:Ie,je=t.rowsPerPage,Ee=void 0===je?10:je,ke=t.selectableCells,Ne=void 0!==ke&&ke,Fe=t.selectableColumns,Ae=void 0!==Fe&&Fe,Me=t.shouldPaginate,He=void 0!==Me&&Me,De=t.sortDownIcon,Te=void 0===De?e.jsx(ln,{className:"st-header-icon"}):De,Le=t.sortUpIcon,Be=void 0===Le?e.jsx(cn,{className:"st-header-icon"}):Le,We=t.tableRef,Oe=t.theme,Pe=void 0===Oe?"light":Oe,qe=t.useHoverRowBackground,ze=void 0===qe||qe,Ye=t.useOddEvenRowBackground,Ge=void 0!==Ye&&Ye,Ke=t.useOddColumnBackground,Ue=void 0!==Ke&&Ke;Ue&&(Ge=!1),y&&(ze=!1);var Ve=n.useReducer(function(e){return e+1},0)[1],Je=n.useRef(null),$e=n.useRef(null),Qe=n.useRef(null),nn=n.useRef(null),tn=n.useRef(null),rn=n.useRef(null),on=n.useRef(null),an=n.useState(1),dn=an[0],hn=an[1],gn=n.useState(H),wn=gn[0],xn=gn[1],yn=n.useState(!1),bn=yn[0],Cn=yn[1],Sn=n.useState(!1),In=Sn[0],Rn=Sn[1],jn=n.useState(null),En=jn[0],kn=jn[1];n.useEffect(function(){xn(H)},[H]);var Nn=mn({rows:Ce,rowIdAccessor:be,onRowSelectionChange:he,enableRowSelection:z}),Fn=Nn.selectedRows,An=Nn.setSelectedRows,Mn=Nn.isRowSelected,Hn=Nn.areAllRowsSelected,Dn=Nn.selectedRowCount,Tn=Nn.selectedRowsData,Ln=Nn.handleRowSelect,Bn=Nn.handleSelectAll,Wn=Nn.handleToggleRow,On=Nn.clearSelection,Pn=n.useMemo(function(){var e,n=s([],wn,!0);z&&!(null===(e=null==wn?void 0:wn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:Re,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[z,wn,Re]),qn=n.useState(0),zn=qn[0],Yn=qn[1],Gn=n.useState(new Set),Kn=Gn[0],Un=Gn[1],Vn=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:rn}),Jn=Vn.scrollbarWidth,Xn=Vn.setScrollbarWidth,_n=n.useMemo(function(){var e=Se({headers:Pn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Pn]),$n=_n.mainBodyWidth,Qn=_n.pinnedLeftWidth,Zn=_n.pinnedRightWidth,et=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:Z,rowHeight:ye}),nt=pn({rows:Ce,headers:wn,rowGrouping:we}),tt=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return vn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return vn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:nt,externalFilterHandling:J,onFilterChange:le}),rt=tt.filters,ot=tt.filteredRows,it=tt.updateFilter,at=tt.clearFilter,st=tt.clearAllFilters,lt=tt.computeFilteredRowsPreview,ct=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=Ze({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(v(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return en({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),p=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},en({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:p}}({headers:wn,tableRows:ot,externalSortHandling:$,onSortChange:ve,rowGrouping:we}),ut=ct.sort,dt=ct.sortedRows,ft=ct.updateSort,ht=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,m=e.rowHeight,w=e.scrollTop,x=e.computeFilteredRowsPreview,y=e.computeSortedRowsPreview,b=n.useState(!1),C=b[0],S=b[1],R=n.useState([]),j=R[0],E=R[1],k=n.useRef([]),N=n.useRef([]),F=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?g({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===F.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(p({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),F.current=n}},[i,M,d]);var H=n.useMemo(function(){return M(r)},[r,M]),D=n.useMemo(function(){return I({bufferRowCount:5,contentHeight:v,tableRows:H,rowHeight:m,scrollTop:w})},[H,v,m,w]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),L=n.useMemo(function(){if(0===k.current.length)return!1;var e=H.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))}),n=k.current.map(function(e){return String(p({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[H,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return E([]),k.current=H,void(N.current=D);if(0===k.current.length)return E([]),k.current=H,void(N.current=D);if(!L)return E([]),k.current=H,void(N.current=D);A.current={tableRows:H,visibleRows:D},S(!0)}},[t,H,L,C,c,D]),n.useLayoutEffect(function(){if(C&&A.current&&j.length>0){var e=setTimeout(function(){var e=A.current;S(!1),E([]),k.current=e.tableRows,N.current=e.visibleRows,A.current=null},_.duration+100);return function(){return clearTimeout(e)}}},[C,j.length]);var B=n.useMemo(function(){if(!t||c)return D;if(j.length>0){var e=new Map;return H.forEach(function(n){var t=String(p({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),j.map(function(n){var t=String(p({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return D},[D,j,H,t,c,d]),W=n.useCallback(function(e){if(t&&!c){var n=x(e),r=M(n),o=I({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=T(D,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],D,!0),i,!0))}},[t,c,x,M,v,m,w,T,H,D,d]),O=n.useCallback(function(e){if(t&&!c){var n=y(e),r=M(n),o=I({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:m,scrollTop:w}),i=T(D,o).entering.map(function(e){var n=String(p({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(p({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],D,!0),i,!0))}},[t,c,y,M,v,m,w,T,H,D,d]);return{currentTableRows:H,currentVisibleRows:D,isAnimating:C,prepareForFilterChange:W,prepareForSortChange:O,rowsToRender:B}}({allowAnimations:l,sortedRows:dt,originalRows:nt,currentPage:dn,rowsPerPage:Ee,shouldPaginate:He,rowGrouping:we,rowIdAccessor:be,unexpandedRows:Kn,expandAll:G,contentHeight:et,rowHeight:ye,scrollTop:zn,computeFilteredRowsPreview:lt,computeSortedRowsPreview:ct.computeSortedRowsPreview}),vt=ht.currentTableRows,pt=ht.rowsToRender,gt=ht.prepareForFilterChange,mt=ht.prepareForSortChange,wt=ht.isAnimating,xt=n.useRef(new Map),yt=n.useRef(new Map),bt=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],v=n.useState(new Set),g=v[0],w=v[1],x=n.useState(null),y=x[0],b=x[1],C=n.useState(null),S=C[0],I=C[1],R=n.useState(new Set),j=R[0],E=R[1],k=n.useState(new Set),N=k[0],F=k[1],A=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),g.forEach(function(n){e.add(n)}),e},[f,g]),D=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),g.size>0&&o.forEach(function(n){var t=p({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,g,o,s]),T=n.useMemo(function(){return r.flatMap(d)},[r]),L=n.useCallback(function(){var e=T.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),E(new Set(f)),setTimeout(function(){E(new Set)},800))},[T,f,o]),B=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!S)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=T.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=S.rowIndex,d=S.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],g=t[h],w=p({row:v.row,rowIdAccessor:s});if(null==g?void 0:g.isEditable){var x=e;if("number"===g.type){var y=Number(e);isNaN(y)||(x=y)}else if("boolean"===g.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===g.type){var b=new Date(e);isNaN(b.getTime())||(x=b)}if(v.row[g.accessor]=x,c){var C="".concat(w,"-").concat(g.accessor),S=c.get(C);S&&S.updateContent(x)}null==l||l({accessor:g.accessor,newValue:x,row:v.row,rowIndex:f});var I=m({colIndex:h,rowIndex:f,rowId:w});r.add(I)}else{var R=m({colIndex:h,rowIndex:f,rowId:w});i.add(R)}}})}),r.size>0&&(E(r),setTimeout(function(){E(new Set)},800)),i.size>0&&(F(i),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[S,T,o,s,l,c]),W=n.useCallback(function(){if(0!==f.size){var e=T.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=p({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var g="".concat(h,"-").concat(f.accessor),m=c.get(g);m&&m.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(E(t),setTimeout(function(){E(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,T,o,s,l,c]),O=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=p({row:o[c].row,rowIdAccessor:s});t.add(m({colIndex:u,rowIndex:c,rowId:d}))}w(new Set),b(null),h(t)},[o,s,w,b,h]),P=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<T.length){var n=m(e);w(new Set),b(null),h(new Set([n])),I(e)}},[T.length,o.length,w,b,h,I]),q=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),I(null),w(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,I,w,b]);n.useEffect(function(){var e=function(e){var n;if(t&&S){var r=S.rowIndex,i=S.colIndex,a=S.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void B();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void W();if(p({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return p({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=p({row:o[r-1].row,rowIdAccessor:s});P({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=p({row:o[r+1].row,rowIdAccessor:s}),P({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=p({row:o[r].row,rowIdAccessor:s}),P({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<T.length-1&&(c=p({row:o[r].row,rowIdAccessor:s}),P({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),w(new Set),b(null),M.current=null,I(null))}else L()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[L,T.length,S,s,O,P,t,o,B,W]);var z=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=g.has(n);return i||a},[f,g]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?p({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?p({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!z(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!z(u)||g.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),z(d)||i.push("st-selected-left-border"),z(f)||i.push("st-selected-right-border"),i.join(" ")},[z,o,g,s]),G=n.useMemo(function(){return S?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===S.rowIndex&&t===S.colIndex&&r===S.rowId}:function(){return!1}},[S]),K=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return j.has(o)},[j]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=m({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:Y,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(A.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){w(new Set),b(null);var e=m({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),I({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&A.current&&M.current){for(var i=new Set,a=Math.min(M.current.rowIndex,r),l=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=p({row:o[d].row,rowIdAccessor:s});i.add(m({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:K,isWarningFlashing:U,isInitialFocusedCell:G,isSelected:z,lastSelectedColumnIndex:y,pasteFromClipboard:B,selectColumns:q,selectedCells:f,selectedColumns:g,setInitialFocusedCell:I,setSelectedCells:h,setSelectedColumns:w,deleteSelectedCells:W,columnsWithSelectedCells:H,rowsWithSelectedCells:D}}({selectableCells:Ne,headers:wn,tableRows:vt,rowIdAccessor:be,onCellEdit:oe,cellRegistry:xt.current}),Ct=bt.getBorderClass,St=bt.handleMouseDown,It=bt.handleMouseOver,Rt=bt.handleMouseUp,jt=bt.isCopyFlashing,Et=bt.isInitialFocusedCell,kt=bt.isSelected,Nt=bt.isWarningFlashing,Ft=bt.selectColumns,At=bt.selectedCells,Mt=bt.selectedColumns,Ht=bt.setInitialFocusedCell,Dt=bt.setSelectedCells,Tt=bt.setSelectedColumns,Lt=bt.columnsWithSelectedCells,Bt=bt.rowsWithSelectedCells,Wt=n.useCallback(function(e){mt(e),setTimeout(function(){ft(e)},0)},[mt,ft]),Ot=n.useCallback(function(e){xn(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Ae,selectedCells:At,selectedColumns:Mt,setSelectedCells:Dt,setSelectedColumns:Tt,activeHeaderDropdown:En,setActiveHeaderDropdown:kn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:Ve,tableBodyContainerRef:rn,setScrollbarWidth:Xn}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:ce}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef,a=e.headerRegistryRef;n.useEffect(function(){t&&(t.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,a=e.newValue,s=null==r?void 0:r[t];if(s){var l=p({row:s,rowIdAccessor:o}),c=u({rowId:l,accessor:n}),d=i.current.get(c);d&&d.updateContent(a),void 0!==s[n]&&(s[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=a.current.get(String(n));t&&t.setEditing(!0)}})},[i,a,r,o,t])}({cellRegistryRef:xt,headerRegistryRef:yt,rowIdAccessor:be,rows:Ce,tableRef:We}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:rt,onFilterChange:le}),function(e){var t=e.sort,r=e.onSortChange,o=O(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:ut,onSortChange:ve});var Pt=n.useCallback(function(e){gt(e),setTimeout(function(){it(e)},0)},[gt,it]);return e.jsx(x,o({value:{allowAnimations:l,areAllRowsSelected:Hn,cellRegistry:xt.current,cellUpdateFlash:f,clearSelection:On,columnBorders:y,columnReordering:F,columnResizing:M,draggedHeaderRef:Je,editColumns:T,enableHeaderEditing:P,enableRowSelection:z,expandIcon:U,filters:rt,forceUpdate:Ve,getBorderClass:Ct,handleApplyFilter:Pt,handleClearAllFilters:st,handleClearFilter:at,handleMouseDown:St,handleMouseOver:It,handleRowSelect:Ln,handleSelectAll:Bn,handleToggleRow:Wn,headerContainerRef:on,headerRegistry:yt.current,headers:Pn,hoveredHeaderRef:$e,isAnimating:wt,isCopyFlashing:jt,isInitialFocusedCell:Et,isResizing:bn,isRowSelected:Mn,isScrolling:In,isSelected:kt,isWarningFlashing:Nt,mainBodyRef:Qe,nextIcon:re,onCellEdit:oe,onCellClick:ie,onColumnOrderChange:ae,onColumnSelect:se,onLoadMore:de,onSort:Wt,onTableHeaderDragEnd:Ot,pinnedLeftRef:nn,pinnedRightRef:tn,prevIcon:ge,rowButtons:me,rowGrouping:we,rowHeight:ye,rowIdAccessor:be,scrollbarWidth:Jn,selectColumns:Ft,selectableColumns:Ae,selectedColumns:Mt,columnsWithSelectedCells:Lt,rowsWithSelectedCells:Bt,selectedRows:Fn,selectedRowCount:Dn,selectedRowsData:Tn,setHeaders:xn,setInitialFocusedCell:Ht,setIsResizing:Cn,setIsScrolling:Rn,setSelectedCells:Dt,setSelectedColumns:Tt,setSelectedRows:An,setUnexpandedRows:Un,shouldPaginate:He,sortDownIcon:Te,sortUpIcon:Be,tableBodyContainerRef:rn,tableRows:vt,theme:Pe,unexpandedRows:Kn,useHoverRowBackground:ze,useOddColumnBackground:Ue,useOddEvenRowBackground:Ge,headerDropdown:Q,activeHeaderDropdown:En,setActiveHeaderDropdown:kn,onHeaderEdit:ue}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(Pe," ").concat(null!=h?h:""," ").concat(y?"st-column-borders":""),style:Z?{height:Z}:{}},{children:e.jsx(un,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(fn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Rt,onMouseLeave:Rt},{children:[e.jsx(Xe,{pinnedLeftWidth:Qn,pinnedRightWidth:Zn,setScrollTop:Yn,sort:ut,tableRows:vt,rowsToRender:pt}),e.jsx(sn,{columnEditorText:k,editColumns:T,editColumnsInitOpen:B,headers:wn,position:j})]})),e.jsx(_e,{mainBodyRef:Qe,mainBodyWidth:$n,pinnedLeftWidth:Qn,pinnedRightWidth:Zn,tableBodyContainerRef:rn}),e.jsx(b,{currentPage:dn,hideFooter:ne,onPageChange:hn,onNextPage:fe,shouldPaginate:He,totalPages:Math.ceil(dt.length/Ee)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(wn,o({},t)):null};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n),o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=n.call(e,i)}catch(e){s=[6,e],r=0}finally{t=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function s(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 l=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},c=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},u=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},d=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return d(e)}):[e]},f=function(e){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(l({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},h=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(l({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){h(e)})},v=function(e){return"number"==typeof e.minWidth?e.minWidth:40},p=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},g=function(e){return e.row[e.rowIdAccessor]},m=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,s=void 0===a?[]:a,l=e.rowIdAccessor,c=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var c=g({row:t,rowIdAccessor:l}),f=s[n],h=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:f,position:r,isLastGroupRow:h}),r++;var v=String(c);if((o?!i.has(v):i.has(v))&&n<s.length){var m=function(e,n){var t=e[n];return p(t)?t:[]}(t,f);m.length>0&&(r=d(m,n+1,r))}}),r};return d(c,t),u},w=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},x=n.createContext(void 0),y=function(n){var t=n.children,r=n.value;return e.jsx(x.Provider,o({value:r},{children:t}))},b=function(){var e=n.useContext(x);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},C=function(t){var r=t.currentPage,s=t.hideFooter,l=t.onPageChange,c=t.onNextPage,u=t.shouldPaginate,d=t.totalPages,f=b(),h=f.nextIcon,v=f.prevIcon,p=n.useState(!0),g=p[0],m=p[1],w=!(r>1),x=!(r<d)&&!c||!g&&r===d;if(s||!u)return null;var y=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 e.jsxs("div",o({className:"st-footer"},{children:[e.jsx("button",o({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=r-1;e>=1&&l(e)},disabled:w},{children:v})),e.jsx("button",o({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===d,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=d||c)&&l(n),[2]}})})},disabled:x},{children:h})),y.map(function(n,t){return n<0?e.jsx("span",o({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",o({onClick:function(){return function(e){e>=1&&e<=d&&l(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},S=function(n){var t=n.className;return e.jsx("svg",o({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},I=function(n){var t=n.className;return e.jsx("svg",o({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,s=Math.max(0,o-a*n),l=o+t+a*n,c=Math.max(0,Math.floor(s/a)),u=Math.min(i.length,Math.ceil(l/a));return i.slice(c,u)},j=function(e){return e.position*(e.rowHeight+1)-1},E=function(e){return e.position*(e.rowHeight+1)},k=function(t){var r=t.children,i=t.onClose,a=t.open,s=t.overflow,l=void 0===s?"auto":s,c=t.setOpen,u=t.width,d=t.containerRef,f=t.positioning,h=void 0===f?"fixed":f,v=b().mainBodyRef,p=n.useRef(null),g=n.useRef(null),m=n.useState("bottom-left"),w=m[0],x=m[1],y=n.useState({}),C=y[0],S=y[1],I=n.useState(!1),R=I[0],j=I[1];return n.useEffect(function(){a&&p.current?(j(!1),!g.current&&p.current.parentElement&&(g.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&g.current){var e,n=p.current,t=g.current.getBoundingClientRect(),r=n.offsetHeight,o=u||n.offsetWidth,i=(e=(null==d?void 0:d.current)?d.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,s="bottom",l={};(r>i&&r<=a||r>i&&a>i)&&(s="top");var c="left";o>e.right-t.right+t.width&&(c="right"),"fixed"===h?("bottom"===s?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===c?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===s?l.top=t.height+4:l.bottom=t.height+4,"left"===c?l.left=0:l.right=0),x("".concat(s,"-").concat(c)),S(l),j(!0)}})):a||j(!1)},[a,u,d,v,h]),n.useEffect(function(){var e=function(e){if(a&&p.current){var n=e.target;p.current&&!p.current.contains(n)&&(c(!1),null==i||i())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,i,c]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(c(!1),null==i||i())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i,a,c]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&a&&(c(!1),null==i||i())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[i,a,c]),a?e.jsx("div",o({ref:p,className:"st-dropdown-content st-dropdown-".concat(w),onClick:function(e){return e.stopPropagation()},style:o(o({position:h,width:u?"".concat(u,"px"):"auto",visibility:R?"visible":"hidden"},C),{overflow:l})},{children:r})):null},N=function(n){var t=n.children,r=n.onClick,i=n.isSelected,a=void 0!==i&&i,s=n.disabled,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c;return e.jsx("div",o({className:"st-dropdown-item ".concat(a?"selected":""," ").concat(l?"disabled":""," ").concat(u),onClick:function(){!l&&r&&r()},role:"option","aria-selected":a,"aria-disabled":l},{children:t}))},F=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value,c=n.useState(l),u=c[0],d=c[1],f=function(e){d(e),i(e),s(!1),r()};return e.jsxs(k,o({open:a,onClose:function(){r()},setOpen:s,width:120},{children:[e.jsx(N,o({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e.jsx(N,o({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},A=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},M=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},H=function(t){var r,i,a=t.onChange,s=t.onClose,l=t.value,c=b(),u=c.nextIcon,d=c.prevIcon,f=n.useState(l||new Date),h=f[0],v=f[1],p=n.useState("days"),g=p[0],m=p[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return e.jsxs("div",o({className:"st-datepicker"},{children:[e.jsxs("div",o({className:"st-datepicker-header"},{children:["days"===g&&e.jsxs(e.Fragment,{children:[e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:d})),e.jsxs("div",o({className:"st-datepicker-header-label",onClick:function(){return m("months")}},{children:[(i=h,i.toLocaleString("default",{month:"long"}))," ",h.getFullYear()]})),e.jsx("button",o({onClick:function(){v(new Date(h.getFullYear(),h.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:u}))]}),"months"===g&&e.jsx("div",o({className:"st-datepicker-header-label",onClick:function(){return m("years")}},{children:h.getFullYear()})),"years"===g&&e.jsx("div",o({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),e.jsxs("div",o({className:"st-datepicker-grid st-datepicker-".concat(g,"-grid")},{children:["days"===g&&function(){var n=[],t=h.getFullYear(),r=h.getMonth(),i=w(t,r),c=function(e,n){return new Date(e,n,1).getDay()}(t,r),u=w(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e.jsx("div",o({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var d=function(t){var r=u-c+t+1;n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()-1,e);v(n),a(n),null==s||s()}(r)}},{children:r}),"prev-".concat(r)))},f=0;f<c;f++)d(f);for(var p=function(i){var c=i===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),u=i===new Date(l).getDate()&&r===new Date(l).getMonth()&&t===new Date(l).getFullYear();n.push(e.jsx("div",o({className:"st-datepicker-day ".concat(c?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth(),e);v(n),a(n),null==s||s()}(i)}},{children:i}),"day-".concat(i)))},g=1;g<=i;g++)p(g);var m=35-(c+i),x=function(t){n.push(e.jsx("div",o({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(h.getFullYear(),h.getMonth()+1,e);v(n),a(n),null==s||s()}(t)}},{children:t}),"next-".concat(t)))};for(g=1;g<=m;g++)x(g);return n}(),"months"===g&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var i=t===h.getMonth();r.push(e.jsx("div",o({className:"st-datepicker-month ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(h.getFullYear(),e,1)),m("days")}(t)}},{children:n}),"month-".concat(t)))}),r),"years"===g&&function(){for(var n=[],t=h.getFullYear(),r=t-6,i=function(r){var i=r===t;n.push(e.jsx("div",o({className:"st-datepicker-year ".concat(i?"selected":""),onClick:function(){return function(e){v(new Date(e,h.getMonth(),1)),m("months")}(r)}},{children:r}),"year-".concat(r)))},a=r;a<r+12;a++)i(a);return n}()]})),e.jsx("div",o({className:"st-datepicker-footer"},{children:e.jsx("button",o({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;v(e),a(e),null==s||s()}},{children:"Today"}))}))]}))},D=function(e){if(!e)return new Date;var n=e.toString().split("-").map(Number),t=n[0],r=n[1],o=n[2],i=new Date;return i.setFullYear(t),i.setMonth(r-1),i.setDate(o),isNaN(i.getTime())?new Date:i},T=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.setOpen,l=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var c=function(){r()};return e.jsx(k,o({open:a,onClose:c,setOpen:s,width:280},{children:e.jsx(H,{value:D(l),onChange:function(e){var n=e.toISOString().split("T")[0];i(n),s(!1),r()},onClose:c})}))},W=function(t){var r=t.onBlur,i=t.onChange,a=t.open,s=t.options,l=t.setOpen,c=t.value,u=n.useState(c||""),d=u[0],f=u[1];return e.jsx(k,o({open:a,onClose:function(){r()},setOpen:l,width:150},{children:e.jsx("div",o({className:"st-enum-dropdown-content"},{children:s.map(function(n){return e.jsx(N,o({isSelected:d===n.value,onClick:function(){return e=n.value,f(e),i(e),l(!1),void r();var e}},{children:n.label}),n.value)})}))}))},L=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,s=void 0===a?"string":a,l=n.value,c=function(){i(!1)};if("boolean"===s&&"boolean"==typeof l)return e.jsx(F,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l});if("date"===s)return e.jsx(T,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l});if("enum"===s){var u="string"==typeof l?l:"";return e.jsx(W,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:u})}if("number"===s&&"number"==typeof l)return e.jsx(M,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var d=null==l?"":String(l);return e.jsx(A,{defaultValue:d,onBlur:c,onChange:o})},B=0,O=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===B||o-B>=r)&&(B=o,n(t))}},P=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},q=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(q);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=q(e[t]));return n},z=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Y=Date.now(),G={screenX:0,screenY:0},K=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 s(s([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=K(o.children,n,s(s([],t,!0),[r],!1));if(i)return i}}return null},U=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function V(e,n,t){var r,i,a=q(e),s=!1;try{var l=U(t),c=a.findIndex(function(e){return e.accessor===n.accessor}),u=a.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===u)return{newHeaders:a,emergencyBreak:s=!0};var d=a.splice(c,1)[0],f=(r=l,i=o({},d),"left"===r?i.pinned="left":"right"===r?i.pinned="right":delete i.pinned,i),h=u;a.splice(h,0,f)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),s=!0}return{newHeaders:a,emergencyBreak:s}}var J=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=b().setHeaders,l=P(t);return{handleDragStart:function(e){n.current=e,Y=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var s=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(c-G.screenX,2)+Math.pow(u-G.screenY,2));r.current=a;var f,h=n.current,v=!1;if(U(h)!==U(a)){f=(C=V(t,h,a)).newHeaders,v=C.emergencyBreak}else{var p=t,g=K(p,h.accessor),m=K(p,a.accessor);if(!g||!m)return;var w=g.length,x=m.length,y=m;if(w!==x){var b=x-w;b>0&&(y=m.slice(0,-b))}var C=function(e,n,t){var r=q(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 s=i(r,n);return a(r,n,i(r,t)),a(r,t,s),{newHeaders:r,emergencyBreak:o}}(p,g,y);f=C.newHeaders,v=C.emergencyBreak}if(!(s||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(S-Y<1500||d<40)||(Y=S,G={screenX:c,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return s([],e,!0)}),null==o||o(t)},10)}}},X=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},_={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},$={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},Q={duration:150,easing:"ease-out",delay:0},Z=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},ee=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){Z(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},ne=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,s=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i,l;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,s),0===e.x&&0===e.y?[2]:X()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),l=function(e,n){return void 0===e&&(e={}),X()?o(o({},Q),e):o(o({},"column"===n?_:$),e)}(t,i?"column":"row"),Z(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,ee(n,l,t)]);case 1:return a.sent(),[2]}})})},te=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,s,l,c,u,d,f,h,v,p,g,m,w;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,s=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,u=t.delay,d=void 0===u?0:u,f=t.onComplete,h=t.respectReducedMotion,v=void 0===h||h,X()&&v?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),g=p.top,m=e-g,w=r-g,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(s,"ms ").concat(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(w,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,s+(d||0)+50)})])})})},re=function(t){var r=t.children,i=t.id,a=t.parentRef,s=t.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(t,["children","id","parentRef","tableRow"]),c=b(),u=c.allowAnimations,d=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=n.useRef(null),p=n.useRef(null),g=P(f),m=P(d);return n.useLayoutEffect(function(){var e,n,t,r;if(u&&v.current&&!d){var i=v.current.getBoundingClientRect(),l=p.current;if(!f)if(!g||f)if(!m||d){if(p.current=i,l){var c=i.x-l.x,w=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(w)<=5)){if(Math.abs(c)>5||Math.abs(w)>5){var x=o(o({},$),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),y=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,b=null===(n=null==a?void 0:a.current)||void 0===n?void 0:n.clientHeight,C=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==y&&void 0!==b&&void 0!==C){var S=5*h,I=y-S,R=y+b+S,j=l.y>I&&l.y<R,E=i.y>I&&i.y<R,k=i.y<y,N=i.y>y+b,F=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:0,A=.6*h,M=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(j&&!E&&N){var H=y+b+M(i.y,y,y+b)+F%15*A*2.5+F%7*(.4*h);return void te({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(j&&!E&&k){H=y-M(i.y,y,y+b)-F%15*A*2.5-F%7*(.4*h);return void te({element:v.current,options:{startY:l.y,endY:H,finalY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y>y+b){var D=y+b+M(l.y,y,y+b)+F%10*A*1;return void te({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}if(!j&&E&&l.y<y){D=y-M(l.y,y,y+b)-F%10*A*1;return void te({element:v.current,options:{startY:D,endY:i.y,duration:x.duration,easing:x.easing,onComplete:x.onComplete}})}}ne({element:v.current,fromBounds:l,toBounds:i,finalConfig:x})}}}}else p.current=i;else p.current=i}},[u,d,f,a,g,m,h,null==s?void 0:s.position,s]),e.jsx("div",o({ref:v,"data-animate-id":i,id:String(i)},l,{children:r}))};re.displayName="Animate";var oe=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:o({height:"10px"},r)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ie=function(n){var t=n.checked,r=void 0!==t&&t,i=n.children,a=n.onChange;return e.jsxs("label",o({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){a&&a(!r)},type:"checkbox"}),e.jsx("span",o({className:"st-checkbox-custom ".concat(r?"st-checked":"")},{children:r&&e.jsx(oe,{className:"st-checkbox-checkmark"})})),i]}))},ae=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},se=function(t){var r=t.borderClass,i=t.colIndex,a=t.header,s=t.isHighlighted,c=t.isInitialFocused,d=t.nestedIndex,f=t.rowIndex,h=t.tableRow,v=b(),m=v.cellRegistry,w=v.cellUpdateFlash,x=v.columnBorders,y=v.draggedHeaderRef,C=v.enableRowSelection,S=v.expandIcon,I=v.handleMouseDown,R=v.handleMouseOver,j=v.handleRowSelect,E=v.headers,k=v.hoveredHeaderRef,N=v.isCopyFlashing,F=v.isRowSelected,A=v.isWarningFlashing,M=v.onCellEdit,H=v.onCellClick,D=v.onTableHeaderDragEnd,T=v.rowButtons,W=v.rowGrouping,B=v.rowIdAccessor,P=v.rowsWithSelectedCells,q=v.selectedColumns,z=v.setUnexpandedRows,Y=v.tableBodyContainerRef,G=v.theme,K=v.unexpandedRows,U=v.useOddColumnBackground,V=h.depth,X=h.row,_=n.useState(X[a.accessor]),$=_[0],Q=_[1],Z=n.useState(!1),ee=Z[0],ne=Z[1],te=n.useState(!1),oe=te[0],se=te[1],le=n.useState(!1),ce=le[0],ue=le[1],de=n.useRef(null),fe=g({row:X,rowIdAccessor:B}),he=W&&W[V],ve=!!he&&function(e,n){if(!n)return!1;var t=e[n];return p(t)}(X,he),pe=!K.has(String(fe)),ge=N({rowIndex:f,colIndex:i,rowId:fe}),me=A({rowIndex:f,colIndex:i,rowId:fe}),we=n.useMemo(function(){var e,n,t;if(!x)return!1;var r=E.filter(function(e){return"left"===e.pinned}),o=E.filter(function(e){return!e.pinned}),i=E.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[x,E,a.accessor,a.pinned]),xe=J({draggedHeaderRef:y,headers:E,hoveredHeaderRef:k,onTableHeaderDragEnd:D}).handleDragOver,ye=O(),be=l({accessor:a.accessor,rowId:fe}),Ce=u({rowId:fe,accessor:a.accessor}),Se=a.isSelectionColumn&&C;n.useEffect(function(){if(m){var e="".concat(fe,"-").concat(a.accessor);return m.set(e,{updateContent:function(e){$!==e?(Q(e),w&&(se(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(function(){se(!1)},800))):Q(e)}}),function(){m.delete(e),de.current&&clearTimeout(de.current)}}},[m,w,fe,a.accessor,$]),n.useEffect(function(){if(oe){var e=setTimeout(function(){se(!1)},850);return function(){return clearTimeout(e)}}},[oe]),n.useEffect(function(){Q(X[a.accessor])},[X,a.accessor]);var Ie="boolean"===a.type||"date"===a.type||"enum"===a.type,Re=Boolean(null==a?void 0:a.isEditable),je=q.has(i),Ee=s&&!je,ke=n.useMemo(function(){return!!Se&&P.has(String(fe))},[Se,P,fe]),Ne="st-cell ".concat(V>0&&a.expandable?"st-cell-depth-".concat(V):""," ").concat(Ee?c?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(je?c?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Re?"clickable":""," ").concat(oe?c?"st-cell-updating-first":"st-cell-updating":""," ").concat(ge?c?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(me?c?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(U?d%2==0?"even-column":"odd-column":""," ").concat(Se?"st-selection-cell":""," ").concat(ke?"st-selection-has-highlighted-cell":""," ").concat(we?"st-last-column":""),Fe=n.useCallback(function(e){Q(e),X[a.accessor]=e,null==M||M({accessor:a.accessor,newValue:e,row:X,rowIndex:f})},[a.accessor,M,X,f]),Ae=n.useCallback(function(){z(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,z]);return!ee||Ie||Se?e.jsxs(re,o({className:Ne,"data-accessor":a.accessor,"data-col-index":i,"data-row-id":fe,"data-row-index":f,id:be,onClick:function(){H&&!Se&&H({accessor:a.accessor,colIndex:i,row:X,rowId:fe,rowIndex:f,value:$})},onDoubleClick:function(){return a.isEditable&&!Se&&ne(!0)},onDragOver:function(e){Se||ye({callback:xe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){ee||Se||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||ee||(e.preventDefault(),ne(!0))},onMouseDown:function(){ee||Se||I({rowIndex:f,colIndex:i,rowId:fe})},onMouseEnter:function(){ue(!0)},onMouseLeave:function(){ue(!1)},onMouseOver:function(){ee||Se||R({rowIndex:f,colIndex:i,rowId:fe})},parentRef:Y,tableRow:h},{children:[a.expandable&&ve?e.jsx("div",o({className:"st-icon-container st-expand-icon-container ".concat(pe?"expanded":"collapsed"),onClick:Ae},{children:S})):null,e.jsx("span",o({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("span",{children:Se?e.jsxs("div",o({className:"st-selection-cell-content"},{children:[e.jsx("div",o({className:"st-selection-control"},{children:ce||F&&F(String(fe))?e.jsx(ie,{checked:!!F&&F(String(fe)),onChange:function(e){j&&j(String(fe),e)}}):e.jsx("span",o({className:"st-row-number"},{children:f+1}))})),function(){if(!T||!Se||0===T.length)return null;if(!(ce||F&&F(String(fe))))return null;var n={row:X};return e.jsx("div",o({className:"st-row-buttons"},{children:T.map(function(t,r){return e.jsx("span",o({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?a.cellRenderer({accessor:a.accessor,colIndex:i,row:X,theme:G}):ae({content:$,header:a})})})),ee&&Ie&&!Se&&e.jsx(L,{enumOptions:a.enumOptions,onChange:Fe,setIsEditing:ne,type:a.type,value:$})]}),Ce):e.jsx("div",o({className:"st-cell-editing",id:l({accessor:a.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(L,{enumOptions:a.enumOptions,onChange:Fe,setIsEditing:ne,type:a.type,value:$})}))},le=function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,s=n.rowIndices,u=n.tableRow,d=b().rowIdAccessor,f=o.filter(function(e){return c({header:e,pinned:i})});return e.jsx(e.Fragment,{children:f.map(function(n,c){var f=g({row:u.row,rowIdAccessor:d}),h=l({accessor:n.accessor,rowId:f});return e.jsx(ce,{columnIndices:r,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:s,tableRow:u},h)})})},ce=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.nestedIndex,s=t.pinned,u=t.rowIndex,d=t.rowIndices,f=t.tableRow,h=r[o.accessor],v=b(),p=v.getBorderClass,m=v.isSelected,w=v.isInitialFocusedCell,x=v.rowIdAccessor,y=g({row:f.row,rowIdAccessor:x});if(o.children){var C=o.children.filter(function(e){return c({header:e,pinned:s})});return e.jsx(n.Fragment,{children:C.map(function(n){var t=l({accessor:n.accessor,rowId:y});return e.jsx(ce,{columnIndices:r,header:n,headers:i,nestedIndex:a,pinned:s,rowIndex:u,rowIndices:d,tableRow:f},t)})})}var S={rowIndex:u,colIndex:h,rowId:y},I=p(S),R=m(S),j=w(S),E=l({accessor:o.accessor,rowId:y});return e.jsx(se,{borderClass:I,colIndex:h,header:o,isHighlighted:R,isInitialFocused:j,nestedIndex:a,rowIndex:u,tableRow:f},E)},ue=function(n){var t=n.columnIndices,r=n.columnIndexStart,i=n.gridTemplateColumns,a=n.headers,s=n.hoveredIndex,l=n.index,c=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,h=n.tableRow,v=b(),p=v.useHoverRowBackground,m=v.rowIdAccessor,w=v.isAnimating,x=v.isRowSelected,y=v.useOddEvenRowBackground,C=h.position,S=C%2==0,I=g({row:h.row,rowIdAccessor:m}),R=!!x&&x(String(I));return e.jsx("div",o({className:"st-row ".concat(y?S?"even":"odd":""," ").concat(s===l&&p?"hovered":""," ").concat(R?"selected":""),onMouseEnter:function(){w||f(l)},style:{gridTemplateColumns:i,top:E({position:C,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(le,{columnIndexStart:r,columnIndices:t,headers:a,pinned:c,rowIndex:C,rowIndices:d,tableRow:h},I)}))},de=function(t){var r=t.displayStrongBorder,i=t.position,a=t.rowHeight,s=t.templateColumns,l=t.rowIndex,c=n.useRef(null);return e.jsx("div",o({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=s.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=s.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,a=0;a<r.length;a++){if(t<=o+r[a]){i=a;break}o+=r[a],i=a}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var f=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(f)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:s,top:j({position:i,rowHeight:a})}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},fe=n.createContext(void 0),he=["default"],ve=function(e){var t=e.childRef,r=e.children,o=function(){var e=n.useContext(fe);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),i=o.registerPane,a=o.unregisterPane;return n.useEffect(function(){return t.current&&i(t.current,he),function(){t.current&&a(t.current,he)}},[t,i,a]),n.cloneElement(r,{ref:function(e){t.current=e}})},pe=function(n){var t=n.condition,r=n.wrapper,o=n.children;return e.jsx(e.Fragment,{children:t?r(o):e.jsx(e.Fragment,{children:o})})},ge=n.forwardRef(function(t,r){var i=t.columnIndexStart,a=t.columnIndices,s=t.headers,l=t.hoveredIndex,c=t.pinned,u=t.rowHeight,d=t.rowIndices,f=t.setHoveredIndex,h=t.templateColumns,v=t.totalHeight,p=t.rowsToRender,m=t.width,w=c?"st-body-pinned-".concat(c):"st-body-main",x=b().rowIdAccessor,y=n.useRef(null);return n.useImperativeHandle(r,function(){return y.current},[]),n.useMemo(function(){return z(s,c)},[s,c])?e.jsx(pe,o({condition:!c,wrapper:function(n){return e.jsx(ve,o({childRef:y},{children:n}))}},{children:e.jsx("div",o({className:w,ref:y,style:o({position:"relative",height:"".concat(v,"px"),width:m},!c&&{flexGrow:1})},{children:p.map(function(t,r){var o=g({row:t.row,rowIdAccessor:x});return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(de,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:h,rowIndex:r-1}),e.jsx(ue,{columnIndexStart:i,columnIndices:a,gridTemplateColumns:h,headers:s,hoveredIndex:l,index:r,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:t},o)]},o)})}))})):null});function me(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o={},i=0,a=function(e,n){void 0===n&&(n=!1),n||i++,o[e.accessor]=i,e.children&&e.children.length>0&&e.children.filter(function(e){return c({header:e})}).forEach(function(e,n){a(e,0===n)})};return t.forEach(function(e,n){a(e,0===n)}),n.filter(function(e){return!e.pinned&&c({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}ge.displayName="TableSection";var we=function(t){var r=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,s=t.pinnedLeftWidth,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,u=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,h=t.tableRows,v=b(),p=v.headerContainerRef,m=v.headers,w=v.isAnimating,x=v.mainBodyRef,y=v.onLoadMore,C=v.rowHeight,S=v.rowIdAccessor,I=v.scrollbarWidth,R=v.setIsScrolling,j=v.shouldPaginate,E=v.tableBodyContainerRef,k=n.useState(null),N=k[0],F=k[1],A=n.useState(!1),M=A[0],H=A[1];n.useEffect(function(){w&&null!==N&&F(null)},[w,N]),function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],s=i[1];n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;s(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(n),function(){n&&i.unobserve(n)}}},[t,r])}({headerContainerRef:p,mainSectionRef:E,scrollbarWidth:I}),n.useEffect(function(){return function(){T.current&&clearTimeout(T.current)}},[]);var D=n.useRef(null),T=n.useRef(null),W=n.useRef(0),L=function(e){return e.length}(h),B=L*(C+1)-1,O=n.useMemo(function(){return me({headers:m,pinnedLeftColumns:i,pinnedRightColumns:l})},[m,i,l]),P=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=String(g({row:n.row,rowIdAccessor:S}));e[r]=t}),e},[d,S]),q=n.useCallback(function(e,n){if(y&&!j&&!M){e.scrollHeight-(n+e.clientHeight)<=200&&n>W.current&&(H(!0),y(),setTimeout(function(){H(!1)},1e3))}},[y,j,M]),z={columnIndices:O,headerContainerRef:p,headers:m,hoveredIndex:N,rowHeight:C,rowIndices:P,rowsToRender:d,setHoveredIndex:F};return e.jsxs("div",o({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(function(){R(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){f(t),q(n,t),W.current=t})},ref:E},{children:[e.jsx(ge,o({},z,{pinned:"left",templateColumns:a,totalHeight:B,width:s})),e.jsx(ge,o({},z,{columnIndexStart:i.length,ref:x,templateColumns:r,totalHeight:B})),e.jsx(ge,o({},z,{columnIndexStart:i.length+r.length,pinned:"right",templateColumns:c,totalHeight:B,width:u}))]}))},xe=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 s=a[i];o=r(s,o)}return o};return r(e,n),t},ye=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,ye(e.children)),n})},be=function(e){return void 0===e&&(e=0),e?e+1:0},Ce=function(e){var n=e.event,t=e.gridColumnEnd,r=e.gridColumnStart,o=e.header,i=e.headers,a=e.setHeaders,l=e.setIsResizing,c=e.startWidth;n.preventDefault();var u="clientX"in n?n.clientX:n.touches[0].clientX,p="touches"in n;if(o&&!o.hide){l(!0);var g=v(o),m=t-r>1,w=m?d(o):[o],x=function(e){var n="right"===o.pinned?u-e:e-u,t=function(e){var n=e.header,t=e.headers,r=document.querySelector(".st-body-container");if(!r||0===r.clientWidth)return 1e3;var o=r.clientWidth,i=.8*o;if(!n.pinned)return Math.max(.6*o,600);var a=i-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+d(n).reduce(function(e,n){return e+f(n)},0)},0),s=v(n);return a<s?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),s):a}({header:o,headers:i});if(m&&w.length>1)Se({delta:n,leafHeaders:w,minWidth:g,startWidth:c,maxWidth:t});else{var r=Math.max(Math.min(c+n,t),g);o.width=r}i.forEach(function(e){h(e)});var l=s([],i,!0);a(l)};if(p){var y=function(e){var n=e.touches[0];x(n.clientX)},b=function(){document.removeEventListener("touchmove",y),document.removeEventListener("touchend",b),l(!1)};document.addEventListener("touchmove",y),document.addEventListener("touchend",b)}else{var C=function(e){x(e.clientX)},S=function(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",S),l(!1)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",S)}}},Se=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,v(n))},40),s=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-s;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=l*(n/s),o=Math.max(n+t,r);e.width=o})},Ie=function(n){var t=n.className,r=n.style;return e.jsx("svg",o({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:o({height:"1em"},r)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Re={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},je=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Ee=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},ke=function(e){return["between","notBetween","in","notIn"].includes(e)},Ne=function(e){return["isEmpty","isNotEmpty"].includes(e)},Fe=function(n){var t=n.children;return e.jsx("div",o({className:"st-filter-container"},{children:t}))},Ae=function(){return e.jsx("svg",o({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Me=function(t){var r=t.value,i=t.onChange,a=t.options,s=t.placeholder,l=void 0===s?"Select...":s,c=t.className,u=void 0===c?"":c,d=t.disabled,f=void 0!==d&&d,h=n.useState(!1),v=h[0],p=h[1],g=n.useState(-1),m=g[0],w=g[1],x=n.useRef(null),y=a.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),w(function(e){return e<a.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),w(function(e){return e>0?e-1:a.length-1});break;case"Enter":e.preventDefault(),m>=0&&(i(a[m].value),p(!1),w(-1));break;case"Escape":e.preventDefault(),p(!1),w(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,m,a,i]);return e.jsxs("div",o({ref:x,className:"st-custom-select ".concat(u," ").concat(f?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",o({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!f)if(p(!v),v)w(-1);else{var e=a.findIndex(function(e){return e.value===r});w(e>=0?e:0)}},disabled:f,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",o({className:"st-custom-select-value"},{children:y?y.label:l})),e.jsx(Ae,{})]})),e.jsx(k,o({open:v,setOpen:p,onClose:function(){p(!1),w(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",o({className:"st-custom-select-options",role:"listbox"},{children:a.map(function(n,t){return e.jsx("div",o({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===m?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,i(e),p(!1),void w(-1);var e}},{children:n.label}),n.value)})}))}))]}))},He=function(n){var t=n.value,r=n.onChange,i=n.operators.map(function(e){return{value:e,label:Re[e]}});return e.jsx("div",o({className:"st-filter-section"},{children:e.jsx(Me,{value:t,onChange:function(e){r(e)},options:i})}))},De=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,s=n.autoFocus,l=void 0!==s&&s,c=n.className,u=void 0===c?"":c,d=n.onEnterPress;return e.jsx("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:l,className:"st-filter-input ".concat(u).trim()})},Te=function(n){var t=n.children,r=n.className,i=void 0===r?"":r;return e.jsx("div",o({className:"st-filter-section ".concat(i).trim()},{children:t}))},We=function(n){var t=n.onApply,r=n.onClear,i=n.canApply,a=n.showClear;return e.jsxs("div",o({className:"st-filter-actions"},{children:[e.jsx("button",o({onClick:t,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&r&&e.jsx("button",o({onClick:r,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Le=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,s=t.onClearFilter,l=n.useState((null==i?void 0:i.operator)||"contains"),c=l[0],u=l[1],d=n.useState(String((null==i?void 0:i.value)||"")),f=d[0],h=d[1],v=je("string");n.useEffect(function(){i?(u(i.operator),h(String(i.value||""))):(u("contains"),h(""))},[i]);var p=function(){var e=o({accessor:r.accessor,operator:c},Ee(c)&&{value:f});a(e)},g=Ne(c)||f.trim();return e.jsxs(Fe,{children:[e.jsx(He,{value:c,onChange:u,operators:v}),Ee(c)&&e.jsx(Te,{children:e.jsx(De,{type:"text",value:f,onChange:h,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(We,{onApply:p,onClear:s,canApply:!!g,showClear:!!i})]})},Be=function(t){var r,o,i=t.header,a=t.currentFilter,s=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),u=c[0],d=c[1],f=n.useState(String((null==a?void 0:a.value)||"")),h=f[0],v=f[1],p=n.useState(String((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")),g=p[0],m=p[1],w=n.useState(String((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")),x=w[0],y=w[1],b=je("number");n.useEffect(function(){var e,n;a?(d(a.operator),v(String(a.value||"")),m(String((null===(e=a.values)||void 0===e?void 0:e[0])||"")),y(String((null===(n=a.values)||void 0===n?void 0:n[1])||""))):(d("equals"),v(""),m(""),y(""))},[a]);var C=function(){var e={accessor:i.accessor,operator:u};Ee(u)?e.value=parseFloat(h):ke(u)&&(e.values=[parseFloat(g.toString()),parseFloat(x.toString())]),s(e)};return e.jsxs(Fe,{children:[e.jsx(He,{value:u,onChange:d,operators:b}),Ee(u)&&e.jsx(Te,{children:e.jsx(De,{type:"number",value:h,onChange:v,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),ke(u)&&e.jsxs(Te,{children:[e.jsx(De,{type:"number",value:g,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(De,{type:"number",value:x,onChange:y,placeholder:"To...",onEnterPress:C})]}),e.jsx(We,{onApply:C,onClear:l,canApply:!!Ne(u)||(Ee(u)?""!==h.trim():!!ke(u)&&""!==String(g).trim()&&""!==String(x).trim()),showClear:!!a})]})},Oe=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,s=n.placeholder;return e.jsx(Me,{value:t,onChange:r,options:o,className:a,placeholder:s})},Pe=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,s=n.useState((null==o?void 0:o.operator)||"equals"),l=s[0],c=s[1],u=n.useState(void 0!==(null==o?void 0:o.value)?String(o.value):"true"),d=u[0],f=u[1],h=je("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?String(o.value):"true")):(c("equals"),f("true"))},[o]);var v=Ne(l)||""!==d;return e.jsxs(Fe,{children:[e.jsx(He,{value:l,onChange:c,operators:h}),Ee(l)&&e.jsx(Te,{children:e.jsx(Oe,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(We,{onApply:function(){var e={accessor:r.accessor,operator:l};Ee(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:v,showClear:!!o})]})},qe=function(t){var r,i,a=t.header,s=t.currentFilter,l=t.onApplyFilter,c=t.onClearFilter,u=n.useState((null==s?void 0:s.operator)||"equals"),d=u[0],f=u[1],h=n.useState((null==s?void 0:s.value)?String(s.value):""),v=h[0],p=h[1],g=n.useState((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),m=g[0],w=g[1],x=n.useState(String((null===(i=null==s?void 0:s.values)||void 0===i?void 0:i[1])||"")),y=x[0],b=x[1],C=je("date");n.useEffect(function(){var e,n;s?(f(s.operator),p(String(s.value||"")),w(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),b(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(f("equals"),p(""),w(""),b(""))},[s]);var S=function(t){var r=t.value,i=t.onChange,a=t.placeholder,s=t.autoFocus,l=t.className,c=n.useState(!1),u=c[0],d=c[1],f=n.useState(""),h=f[0],v=f[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=new Date(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){s&&p.current&&p.current.focus()},[s]);var g=r?new Date(r):new Date;return e.jsxs("div",o({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:h,placeholder:a,onClick:function(){d(!u)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),d(!u)):"Escape"===e.key&&d(!1)},readOnly:!0,className:"st-filter-input ".concat(l||""),style:{cursor:"pointer"}}),e.jsx(k,o({open:u,setOpen:d,onClose:function(){d(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(H,{value:g,onChange:function(e){var n=e.toISOString().split("T")[0];i(n),d(!1)},onClose:function(){return d(!1)}})}))]}))};return e.jsxs(Fe,{children:[e.jsx(He,{value:d,onChange:f,operators:C}),Ee(d)&&e.jsx(Te,{children:e.jsx(S,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),ke(d)&&e.jsxs(Te,{children:[e.jsx(S,{value:m,onChange:w,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(S,{value:y,onChange:b,placeholder:"To date..."})]}),e.jsx(We,{onApply:function(){var e={accessor:a.accessor,operator:d};Ee(d)?e.value=v:ke(d)&&(e.values=[m,y]),l(e)},onClear:c,canApply:!!Ne(d)||(Ee(d)?""!==v.trim():!!ke(d)&&""!==m.trim()&&""!==y.trim()),showClear:!!s})]})},ze=function(t){var r=t.header,i=t.currentFilter,a=t.onApplyFilter,l=t.onClearFilter,c=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),u=n.useMemo(function(){return c.map(function(e){return e.value})},[c]),d=n.useState((null==i?void 0:i.values)?i.values.map(String):u),f=d[0],h=d[1];n.useEffect(function(){h(i?i.values?i.values.map(String):[]:u)},[i,u]);var v=f.length===u.length;return e.jsxs(Fe,{children:[e.jsx(Te,{children:e.jsxs("div",o({className:"st-enum-filter-options"},{children:[e.jsx("div",o({className:"st-enum-select-all"},{children:e.jsx(ie,o({checked:v,onChange:function(e){h(e?u:[])}},{children:e.jsx("span",o({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),c.map(function(n){return e.jsx(ie,o({checked:f.includes(n.value),onChange:function(){return e=n.value,void h(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):s(s([],n,!0),[e],!1)});var e}},{children:e.jsx("span",o({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e.jsx(We,{onApply:function(){if(f.length!==u.length){var e={accessor:r.accessor,operator:"in",values:f};a(e)}else l()},onClear:l,canApply:0!==f.length&&f.length!==u.length,showClear:!!i})]})},Ye=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(Be,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(Pe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(qe,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(ze,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(Le,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},Ge=function(t){var r,i,a=t.colIndex,c=t.gridColumnEnd,u=t.gridColumnStart,d=t.gridRowEnd,f=t.gridRowStart,h=t.header,v=t.reverse,p=t.sort,g=n.useState(!1),m=g[0],w=g[1],x=n.useState(!1),y=x[0],C=x[1],S=n.useState(h.label||""),I=S[0],R=S[1],j=b(),E=j.activeHeaderDropdown,N=j.areAllRowsSelected,F=j.columnBorders,M=j.columnReordering,H=j.columnResizing,D=j.columnsWithSelectedCells,T=j.draggedHeaderRef,W=j.enableHeaderEditing,L=j.enableRowSelection,B=j.filters,P=j.handleApplyFilter,q=j.handleClearFilter,z=j.handleSelectAll,Y=j.headerDropdown,G=j.headerRegistry,K=j.headers,U=j.hoveredHeaderRef,V=j.onColumnOrderChange,X=j.onColumnSelect,_=j.onHeaderEdit,$=j.onSort,Q=j.onTableHeaderDragEnd,Z=j.rowHeight,ee=j.selectColumns,ne=j.selectableColumns,te=j.selectedColumns,oe=j.setActiveHeaderDropdown,ae=j.setHeaders,se=j.setInitialFocusedCell,le=j.setIsResizing,ce=j.setSelectedCells,ue=j.setSelectedColumns,de=j.sortDownIcon,fe=j.sortUpIcon,he=Boolean(null==h?void 0:h.isSortable),ve=Boolean(null==h?void 0:h.filterable),pe=B[h.accessor],ge=(null==E?void 0:E.accessor)===h.accessor,me=h.isSelectionColumn&&L,we=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,s=e.margin,l=void 0===s?4:s,c=n.useRef(null),u=n.useState({}),d=u[0],f=u[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,r=window.innerWidth-e.right,i="bottom",s={};o>n&&o<=t&&(i="top");var u="left";a>r+e.width&&(u="right"),"bottom"===i?s.top=e.bottom+l:s.bottom=window.innerHeight-e.top+l,"left"===u?s.left=e.left:s.right=window.innerWidth-e.right,f(s)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:ge,estimatedHeight:200,estimatedWidth:250,margin:4}),ye=we.triggerRef,be=we.position,Se=n.useMemo(function(){var e,n,t;if(!F)return!1;var r=K.filter(function(e){return"left"===e.pinned}),o=K.filter(function(e){return!e.pinned}),i=K.filter(function(e){return"right"===e.pinned});return"left"===h.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===h.accessor:"right"===h.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===h.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===h.accessor},[F,K,h.accessor,h.pinned]),Re=n.useMemo(function(){return!(!ne||me)&&xe(h,a).some(function(e){return te.has(e)})},[ne,me,h,a,te]),je=n.useMemo(function(){return!me&&D.has(a)},[me,D,a]),Ee="st-header-cell ".concat(h.accessor===(null===(r=U.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=T.current)||void 0===i?void 0:i.accessor)===h.accessor?"st-dragging":""," ").concat(he?"clickable":""," ").concat(M&&!he?"columnReordering":""," ").concat(h.children?"parent":""," ").concat(Se?"st-last-column":""," ").concat(W&&!me?"st-header-editable":""," ").concat(Re?"st-header-selected":""," ").concat(je&&!Re?"st-header-has-highlighted-cell":""),ke=J({draggedHeaderRef:T,headers:K,hoveredHeaderRef:U,onColumnOrderChange:V,onTableHeaderDragEnd:Q}),Ne=ke.handleDragStart,Fe=ke.handleDragEnd,Ae=ke.handleDragOver,Me=O();n.useEffect(function(){if(G&&!h.isSelectionColumn){var e=String(h.accessor);return G.set(e,{setEditing:function(e){C(e)}}),function(){G.delete(e)}}},[G,h.accessor,h.isSelectionColumn]),n.useEffect(function(){R(h.label||"")},[h.label]);var He=n.useCallback(function(e){R(e);var n=K.map(function(n){return n.accessor===h.accessor?o(o({},n),{label:e}):n});ae(n),_&&_(h,e)},[K,ae,_,h]);n.useCallback(function(){oe&&oe(ge?null:h)},[oe,ge,h]);var De=n.useCallback(function(){oe&&oe(null)},[oe]),Te=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(ne){var r=xe(t,a),o=r.some(function(e){return te.has(e)});if(W&&o&&!n.shiftKey)return Y&&ge&&De(),void C(!0);n.shiftKey&&ee?ue(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,u,d=s(s([],(a=o,l=n,c=Math.min(a,l),u=Math.max(a,l),Array.from({length:u-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(s(s([],Array.from(e),!0),d,!0))}):ee&&ee(r),ce(new Set),se(null)}X&&X(t),!ne&&t.isSortable&&$(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!h)return null;var We=H&&!me&&e.jsx("div",o({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Me({callback:Ce,callbackProps:{event:e.nativeEvent,gridColumnEnd:c,gridColumnStart:u,header:h,headers:K,setHeaders:ae,setIsResizing:le,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(l({accessor:h.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Me({callback:Ce,callbackProps:{event:e,gridColumnEnd:c,gridColumnStart:u,header:h,headers:K,setHeaders:ae,setIsResizing:le,startWidth:t},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Le=p&&p.key.accessor===h.accessor&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){return Te({event:e,header:h})}},{children:["ascending"===p.direction&&fe&&fe,"descending"===p.direction&&de&&de]})),Be=ve&&e.jsxs("div",o({className:"st-icon-container",onClick:function(e){e.stopPropagation(),w(!m)}},{children:[e.jsx(Ie,{className:"st-header-icon",style:{fill:pe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(k,o({open:m,overflow:"visible",setOpen:w,onClose:function(){return w(!1)}},{children:e.jsx(Ye,{header:h,currentFilter:pe,onApplyFilter:function(e){P(e),w(!1)},onClearFilter:function(){q(h.accessor),w(!1)}})}))]}));return e.jsxs(re,o({className:Ee,id:l({accessor:h.accessor,rowId:"header"}),onDragOver:function(e){me||Me({callback:Ae,callbackProps:{event:e,hoveredHeader:h},limit:50})},style:o(o({gridRowStart:f,gridRowEnd:d,gridColumnStart:u,gridColumnEnd:c},c-u>1?{}:{width:h.width}),d-f>1?{}:{height:Z})},{children:[v&&We,"right"===h.align&&Be,"right"===h.align&&Le,e.jsx("div",o({ref:ye,className:"st-header-label",draggable:M&&!h.disableReorder&&!me,onClick:function(e){me||Te({event:e,header:h})},onDoubleClick:function(e){me||function(e){e.event;var n=e.header;n.isSelectionColumn||ne&&n.isSortable&&$(n.accessor)}({event:e,header:h})},onDragEnd:me?void 0:function(e){e.preventDefault(),Fe()},onDragStart:me?void 0:function(e){M&&h&&function(e){Ne(e)}(h)}},{children:e.jsx("span",o({className:"st-header-label-text ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"left-aligned")},{children:me?e.jsx(ie,{checked:!!N&&N(),onChange:function(e){z&&z(e)}}):y?e.jsx(A,{defaultValue:I,onBlur:function(){return C(!1)},onChange:He}):h.headerRenderer?h.headerRenderer({accessor:h.accessor,colIndex:a,header:h}):I||(null==h?void 0:h.label)}))})),"right"!==h.align&&Le,"right"!==h.align&&Be,!v&&We,Y&&!me&&e.jsx("div",o({className:"st-header-dropdown-container"},{children:Y({accessor:h.accessor,colIndex:a,header:h,isOpen:ge,onClose:De,position:be})}))]}))},Ke=function(t){var r=t.columnIndices,i=t.gridTemplateColumns,a=t.handleScroll,s=t.headers,l=t.maxDepth,u=t.pinned,d=t.sectionRef,f=t.sort,h=t.width,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,a){var s,d;if(void 0===a&&(a=!1),!c({header:o,pinned:u}))return 0;a||n++;var f=null!==(d=null===(s=o.children)||void 0===s?void 0:s.filter(function(e){return c({header:e,pinned:u})}).length)&&void 0!==d?d:0,h=n,v=f>0?h+f:h+1,p=i,g=f>0?i+1:l+1;if(e.push({header:o,gridColumnStart:h,gridColumnEnd:v,gridRowStart:p,gridRowEnd:g,colIndex:r[o.accessor]}),o.children){var m=!0;o.children.forEach(function(e){c({header:e,pinned:u})&&(t(e,i+1,m),m=!1)})}return v-h},o=s.filter(function(e){return c({header:e,pinned:u})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[s,l,u,r]);return e.jsx(pe,o({condition:!u,wrapper:function(n){return e.jsx(ve,o({childRef:d},{children:n}))}},{children:e.jsx("div",o({className:"st-header-".concat(u?"pinned-".concat(u):"main")},a&&{onScroll:a},{ref:d,style:{gridTemplateColumns:i,display:"grid",position:"relative",width:h}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(Ge,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===u,sort:f},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},Ve=function(t){var r=t.centerHeaderRef,i=t.headers,a=t.mainTemplateColumns,s=t.pinnedLeftColumns,l=t.pinnedLeftTemplateColumns,u=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.sort,h=t.pinnedLeftWidth,v=t.pinnedRightWidth,p=b(),g=p.headerContainerRef,m=p.pinnedLeftRef,w=p.pinnedRightRef,x=n.useMemo(function(){return me({headers:i,pinnedLeftColumns:s,pinnedRightColumns:u})},[i,s,u]),y=n.useMemo(function(){var e=0;return i.forEach(function(n){if(c({header:n})){var t=Ue(n);e=Math.max(e,t)}}),{maxDepth:e}},[i]).maxDepth;return e.jsxs("div",o({className:"st-header-container",ref:g},{children:[z(i,"left")&&e.jsx(Ke,{columnIndices:x,gridTemplateColumns:l,handleScroll:void 0,headers:i,maxDepth:y,pinned:"left",sectionRef:m,sort:f,width:h}),e.jsx(Ke,{columnIndices:x,gridTemplateColumns:a,handleScroll:void 0,headers:i,maxDepth:y,sectionRef:r,sort:f}),z(i,"right")&&e.jsx(Ke,{columnIndices:x,gridTemplateColumns:d,handleScroll:void 0,headers:i,maxDepth:y,pinned:"right",sectionRef:w,sort:f,width:v})]}))},Je=function(e){var n=e.headers,t=function(e){var n=e.headers,r=e.flattenedHeaders;return n.forEach(function(e){e.hide||(e.children?t({headers:e.children,flattenedHeaders:r}):r.push(e))}),r},r=t({headers:n,flattenedHeaders:[]});return"".concat(r.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},Xe=function(t){var r=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,s=t.sort,l=t.tableRows,c=t.rowsToRender,u=b(),d=u.columnResizing,f=u.editColumns,h=u.headers,v=n.useRef(null),p=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),m=h.filter(function(e){return"right"===e.pinned}),w=n.useMemo(function(){return Je({headers:g})},[g]),x=n.useMemo(function(){return Je({headers:p})},[p]),y=n.useMemo(function(){return Je({headers:m})},[m]),C={centerHeaderRef:v,headers:h,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedRightColumns:m,pinnedRightTemplateColumns:y,sort:s,pinnedLeftWidth:r,pinnedRightWidth:i},S={tableRows:l,mainTemplateColumns:x,pinnedLeftColumns:g,pinnedLeftTemplateColumns:w,pinnedLeftWidth:r,pinnedRightColumns:m,pinnedRightTemplateColumns:y,pinnedRightWidth:i,setScrollTop:a,rowsToRender:c};return e.jsxs("div",o({className:"st-content ".concat(d?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Ve,o({},C)),e.jsx(we,o({},S))]}))},_e=function(t){var r,i,a=t.mainBodyWidth,s=t.mainBodyRef,l=t.pinnedLeftWidth,c=t.pinnedRightWidth,u=t.tableBodyContainerRef,d=b().editColumns,f=n.useState(!1),h=f[0],v=f[1],p=n.useRef(null),g=u.current&&u.current.scrollHeight>u.current.clientHeight,m=d?28:0,w=(d?c+1:c)+(u.current&&g?u.current.offsetWidth-u.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){!function(){if(s.current){var e=s.current.clientWidth;v(a>e)}}()},1)},[s,a]),h?e.jsxs("div",o({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:l,height:null===(r=p.current)||void 0===r?void 0:r.offsetHeight}}),a>0&&e.jsx(ve,o({childRef:p},{children:e.jsx("div",o({className:"st-horizontal-scrollbar-middle",ref:p,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})}))})),c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:w,height:null===(i=p.current)||void 0===i?void 0:i.offsetHeight}}),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},$e={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 $e.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?$e.string(e,n,t):"number"==typeof e&&"number"==typeof n?$e.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?$e.boolean(e,n,t):$e.string(String(e),String(n),t)}},Qe=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return s([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return $e.number(i,a,r)}return"date"===t?$e.date(String(e),String(n),r):"boolean"===t?$e.boolean(Boolean(e),Boolean(n),r):"enum"===t?$e.enum(String(e),String(n),r):$e.string(String(e),String(n),r)}(e[r],n[r],a,l)})},Ze=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return Qe({rows:t,sortColumn:r,headers:n})},en=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):Ze({headers:i,rows:t,sortColumn:r}):t},nn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),s=!1;if(!a)for(var l=0,c=i.children;l<c.length;l++){var u=c[l];if(nn([u],n,t),!1===u.hide){s=!0;break}}(a||s)&&(i.hide=!1)}}},tn=function(e){return e.every(function(e){return e.hide})},rn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(rn(e.children),tn(e.children)&&(e.hide=!0))})},on=function(t){var r=t.allHeaders,i=t.depth,a=void 0===i?0:i,l=t.doesAnyHeaderHaveChildren,c=t.header,u=t.isCheckedOverride,d=n.useState(!0),f=d[0],h=d[1],v=b(),p=v.expandIcon,g=v.headers,m=v.setHeaders,w=l?"".concat(16*a,"px"):"8px",x=c.children&&c.children.length>0,y=null!=u?u:c.hide||x&&c.children&&tn(c.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",o({className:"st-header-checkbox-item",style:{paddingLeft:w}},{children:[l&&e.jsx("div",o({className:"st-header-icon-container"},{children:x?e.jsx("div",o({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e.jsx(ie,o({checked:y,onChange:function(e){(c.hide=e,e)?rn(r):(nn(r,c.accessor),x&&c.children&&c.children.length>0&&c.children.every(function(e){return!0===e.hide})&&c.children[0]&&(c.children[0].hide=!1,nn(r,c.children[0].accessor)));m(s([],g,!0))}},{children:c.label}))]})),x&&f&&c.children&&e.jsx("div",o({className:"st-nested-headers"},{children:c.children.map(function(n,t){return e.jsx(on,{allHeaders:r,depth:a+1,doesAnyHeaderHaveChildren:l,header:n,isCheckedOverride:!!y||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},an=function(t){var r=t.headers,i=t.open,a="left"===t.position?"left":"",s=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",o({className:"st-column-editor-popout ".concat(i?"open":""," ").concat(a),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",o({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn?null:e.jsx(on,{doesAnyHeaderHaveChildren:s,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},sn=function(t){var r=t.columnEditorText,i=t.editColumns,a=t.editColumnsInitOpen,s=t.headers,l=t.position,c=void 0===l?"right":l,u=n.useState(a),d=u[0],f=u[1];return i?e.jsxs("div",o({className:"st-column-editor ".concat(d?"open":""," ").concat(c),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e.jsx("div",o({className:"st-column-editor-text"},{children:r})),e.jsx(an,{headers:s,open:d,position:c})]})):null},ln=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},cn=function(n){var t=n.className;return e.jsx("svg",o({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},un=function(t){var i=t.children,a=n.useRef({}),s=n.useCallback(function(e,n){return!!a.current[n]&&a.current[n].find(function(n){return n===e})},[]),l=n.useCallback(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),c=n.useCallback(function(e){e.onscroll=null},[]),u=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=a.current[n])||void 0===t||t.forEach(function(n){e!==n&&(c(n),l(e,n),window.requestAnimationFrame(function(){var e=Object.keys(a.current).filter(function(e){return a.current[e].includes(n)});u(n,e)}))})})})}},[c,l]),d=n.useCallback(function(e,n){n.forEach(function(n){a.current[n]||(a.current[n]=[]),s(e,n)||(a.current[n].length>0&&l(a.current[n][0],e),a.current[n].push(e))}),u(e,n)},[s,l,u]),f=n.useCallback(function(e,n){n.forEach(function(n){if(s(e,n)){c(e);var t=a.current[n].indexOf(e);-1!==t&&a.current[n].splice(t,1)}})},[s,c]);return e.jsx(fe.Provider,o({value:{registerPane:d,unregisterPane:f}},{children:r.default.Children.only(i)}))},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=Re[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)},fn=function(){var n=b(),t=n.filters,r=n.handleClearFilter,i=n.headers,a=Object.values(t);return 0===a.length||a.length>0?null:e.jsx("div",o({className:"st-filter-bar"},{children:e.jsx("div",o({className:"st-filter-bar-content"},{children:e.jsx("div",o({className:"st-filter-chips"},{children:a.map(function(n){return e.jsxs("div",o({className:"st-filter-chip"},{children:[e.jsx("span",o({className:"st-filter-chip-text"},{children:dn(n,i)})),e.jsx("button",o({className:"st-filter-chip-remove",onClick:function(){return r(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},hn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},vn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(r).toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(Number(e))){var s=Number(e),l=Number(r);switch(t){case"equals":return s===l;case"notEquals":return s!==l;case"greaterThan":return s>l;case"lessThan":return s<l;case"greaterThanOrEqual":return s>=l;case"lessThanOrEqual":return s<=l;case"between":if(o&&2===o.length){var c=o.map(Number),u=c[0],d=c[1];return s>=u&&s<=d}return!1;case"notBetween":if(o&&2===o.length){var f=o.map(Number);return u=f[0],d=f[1],s<u||s>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var h=new Date(e),v=new Date(String(r||"")),p=hn(h),g=hn(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var m=o.map(function(e){return hn(new Date(String(e||"")))}),w=m[0],x=m[1];return p>=w&&p<=x}return!1;case"notBetween":if(o&&2===o.length){var y=o.map(function(e){return hn(new Date(String(e||"")))});return w=y[0],x=y[1],p<w||p>x}return!0}}if("boolean"==typeof e){var b=Boolean(r);if("equals"===t)return e===b}if(Array.isArray(e)){var C=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=C}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),I=o.includes(S);return"in"===t?I:!I}return!1}var R=String(e).toLowerCase(),j=r?String(r).toLowerCase():"";switch(t){case"equals":return R===j;case"notEquals":return R!==j;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},pn=function(e){var t=e.rows,r=e.headers,i=e.rowGrouping;return n.useMemo(function(){if(!i||0===i.length)return t;var e=function(e){return ye(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),a=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=i[t],s=i[t+1],l=n[r];if(l&&p(l)){var c=a(l,t+1),u=o({},n);return u[r]=c,e.forEach(function(e){var n=gn(c,e.accessor,e.aggregation,s);void 0!==n&&(u[e.accessor]=n)}),u}return n})};return a(n)},[t,r,i])},gn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&p(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,s=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===s.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=s.reduce(function(e,n){return e+n},0);break;case"average":a=s.reduce(function(e,n){return e+n},0)/s.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,s);break;case"max":a=Math.max.apply(Math,s);break;default:return}return t.formatResult?t.formatResult(a):a}},mn=function(e){var t=e.rows,r=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,s=n.useState(new Set),l=s[0],c=s[1],u=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(t,r,l)},[t,r,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),h=n.useMemo(function(){return a?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(t,r,l):[]},[t,r,l,a]),v=n.useCallback(function(e,n){if(a){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,l);if(c(i),o){var s=t.find(function(n){return String(n[r])===e});s&&o({row:s,isSelected:n,selectedRows:i})}}},[l,t,r,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(t,r),o&&t.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=t.find(function(n){return String(n[r])===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),c(n))},[t,r,o,l,a]),g=n.useCallback(function(e){if(a){var n=u(e);v(e,!n)}},[u,v,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=t.find(function(e){return String(e[r])===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}c(new Set)}},[l,t,r,o,a]);return{selectedRows:l,setSelectedRows:c,isRowSelected:u,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:h,handleRowSelect:v,handleSelectAll:p,handleToggleRow:g,clearSelection:m}},wn=function(t){var r=t.allowAnimations,l=void 0!==r&&r,c=t.cellUpdateFlash,h=void 0!==c&&c,v=t.className,x=t.columnBorders,b=void 0!==x&&x,j=t.columnEditorPosition,E=void 0===j?"right":j,k=t.columnEditorText,N=void 0===k?"Columns":k,F=t.columnReordering,A=void 0!==F&&F,M=t.columnResizing,H=void 0!==M&&M,D=t.defaultHeaders,T=t.editColumns,W=void 0!==T&&T,L=t.editColumnsInitOpen,B=void 0!==L&&L,O=t.enableHeaderEditing,q=void 0!==O&&O,z=t.enableRowSelection,Y=void 0!==z&&z,G=t.expandAll,K=void 0===G||G,U=t.expandIcon,V=void 0===U?e.jsx(I,{className:"st-expand-icon"}):U,J=t.externalFilterHandling,X=void 0!==J&&J,_=t.externalSortHandling,Q=void 0!==_&&_,Z=t.headerDropdown,ee=t.height,ne=t.hideFooter,te=void 0!==ne&&ne,re=t.nextIcon,oe=void 0===re?e.jsx(I,{className:"st-next-prev-icon"}):re,ie=t.onCellEdit,ae=t.onCellClick,se=t.onColumnOrderChange,le=t.onColumnSelect,ce=t.onFilterChange,ue=t.onGridReady,de=t.onHeaderEdit,fe=t.onLoadMore,he=t.onNextPage,ve=t.onRowSelectionChange,pe=t.onSortChange,ge=t.prevIcon,me=void 0===ge?e.jsx(S,{className:"st-next-prev-icon"}):ge,we=t.rowButtons,xe=t.rowGrouping,ye=t.rowHeight,Ce=void 0===ye?32:ye,Se=t.rowIdAccessor,Ie=t.rows,Re=t.selectionColumnWidth,je=void 0===Re?42:Re,Ee=t.rowsPerPage,ke=void 0===Ee?10:Ee,Ne=t.selectableCells,Fe=void 0!==Ne&&Ne,Ae=t.selectableColumns,Me=void 0!==Ae&&Ae,He=t.shouldPaginate,De=void 0!==He&&He,Te=t.sortDownIcon,We=void 0===Te?e.jsx(ln,{className:"st-header-icon"}):Te,Le=t.sortUpIcon,Be=void 0===Le?e.jsx(cn,{className:"st-header-icon"}):Le,Oe=t.tableRef,Pe=t.theme,qe=void 0===Pe?"light":Pe,ze=t.useHoverRowBackground,Ye=void 0===ze||ze,Ge=t.useOddEvenRowBackground,Ke=void 0!==Ge&&Ge,Ue=t.useOddColumnBackground,Ve=void 0!==Ue&&Ue;Ve&&(Ke=!1),b&&(Ye=!1);var Je=n.useReducer(function(e){return e+1},0)[1],$e=n.useRef(null),Qe=n.useRef(null),nn=n.useRef(null),tn=n.useRef(null),rn=n.useRef(null),on=n.useRef(null),an=n.useRef(null),dn=n.useState(1),hn=dn[0],gn=dn[1],wn=n.useState(D),xn=wn[0],yn=wn[1],bn=n.useState(!1),Cn=bn[0],Sn=bn[1],In=n.useState(!1),Rn=In[0],jn=In[1],En=n.useState(null),kn=En[0],Nn=En[1];n.useEffect(function(){yn(D)},[D]);var Fn=mn({rows:Ie,rowIdAccessor:Se,onRowSelectionChange:ve,enableRowSelection:Y}),An=Fn.selectedRows,Mn=Fn.setSelectedRows,Hn=Fn.isRowSelected,Dn=Fn.areAllRowsSelected,Tn=Fn.selectedRowCount,Wn=Fn.selectedRowsData,Ln=Fn.handleRowSelect,Bn=Fn.handleSelectAll,On=Fn.handleToggleRow,Pn=Fn.clearSelection,qn=n.useMemo(function(){var e,n=s([],xn,!0);Y&&!(null===(e=null==xn?void 0:xn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=s([{accessor:"__row_selection__",label:"",width:je,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[Y,xn,je]),zn=n.useState(0),Yn=zn[0],Gn=zn[1],Kn=n.useState(new Set),Un=Kn[0],Vn=Kn[1],Jn=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){if(t.current){var e=t.current.offsetWidth-t.current.clientWidth;i(e)}},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:on}),Xn=Jn.scrollbarWidth,_n=Jn.setScrollbarWidth,$n=n.useState(0),Qn=$n[0],Zn=$n[1];n.useLayoutEffect(function(){var e=function(){on.current&&Zn(on.current.clientWidth)};e();var n=null;return on.current&&(n=new ResizeObserver(e)).observe(on.current),function(){n&&n.disconnect()}},[]);var et=n.useMemo(function(){var e=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=0,a=0,s=0;if(n.forEach(function(e){if(!e.hide){var n=d(e).reduce(function(e,n){return e+f(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:s+=n}}),t&&t>0){var l=t*o;i>l&&(i=l),a>l&&(a=l)}return{leftWidth:be(i),rightWidth:be(a),mainWidth:s}}({headers:qn,containerWidth:Qn});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[qn,Qn]),nt=et.mainBodyWidth,tt=et.pinnedLeftWidth,rt=et.pinnedRightWidth,ot=function(e){var t=e.height,r=e.rowHeight;return n.useMemo(function(){var e;if(!t)return window.innerHeight-r;var n=document.querySelector(".simple-table-root"),o=0;if(t.endsWith("px"))o=parseInt(t,10);else if(t.endsWith("vh")){var i=parseInt(t,10);o=window.innerHeight*i/100}else if(t.endsWith("%")){var a=parseInt(t,10);o=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;return Math.max(0,o-r)},[t,r])}({height:ee,rowHeight:Ce}),it=pn({rows:Ie,headers:xn,rowGrouping:xe}),at=function(e){var t=e.rows,r=e.externalFilterHandling,i=e.onFilterChange,a=n.useState({}),s=a[0],l=a[1],c=n.useMemo(function(){return vn({externalFilterHandling:r,tableRows:t,filterState:s})},[t,s,r]),u=n.useCallback(function(e){var n,t=o(o({},s),((n={})[e.accessor]=e,n));l(t),null==i||i(t)},[s,i]),d=n.useCallback(function(e){var n=o({},s);delete n[e],l(n),null==i||i(n)},[s,i]),f=n.useCallback(function(){l({}),null==i||i({})},[i]),h=n.useCallback(function(e){var n,i=o(o({},s),((n={})[e.accessor]=e,n));return vn({externalFilterHandling:r,tableRows:t,filterState:i})},[s,t,r]);return{filteredRows:c,updateFilter:u,clearFilter:d,clearAllFilters:f,filters:s,computeFilteredRowsPreview:h}}({rows:it,externalFilterHandling:X,onFilterChange:ce}),st=at.filters,lt=at.filteredRows,ct=at.updateFilter,ut=at.clearFilter,dt=at.clearAllFilters,ft=at.computeFilteredRowsPreview,ht=function(e){var t=e.headers,r=e.tableRows,i=e.externalSortHandling,a=e.onSortChange,s=e.rowGrouping,l=n.useState(null),c=l[0],u=l[1],d=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,i=e.sortColumn,a=Ze({headers:t,rows:r,sortColumn:i});return n&&0!==n.length?a.map(function(e){var r,a=n[0],s=e[a];if(p(s)){var l=d({rows:s,sortColumn:i,headers:t,groupingKeys:n.slice(1)});return o(o({},e),((r={})[a]=l,r))}return e}):a},[]),f=n.useMemo(function(){return en({externalSortHandling:i,tableRows:r,sortColumn:c,rowGrouping:s,headers:t,sortNestedRows:d})},[r,c,t,i,s,d]),h=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},r=n(t);if(r){var o=null;c&&c.key.accessor===e?"ascending"===c.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},u(o),null==a||a(o)}},[c,t,a]),v=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},o=n(t);if(!o)return r;var a=null;return c&&c.key.accessor===e?"ascending"===c.direction&&(a={key:o,direction:"descending"}):a={key:o,direction:"ascending"},en({externalSortHandling:i,tableRows:r,sortColumn:a,rowGrouping:s,headers:t,sortNestedRows:d})},[c,t,r,i,s,d]);return{sort:c,sortedRows:f,updateSort:h,computeSortedRowsPreview:v}}({headers:xn,tableRows:lt,externalSortHandling:Q,onSortChange:pe,rowGrouping:xe}),vt=ht.sort,pt=ht.sortedRows,gt=ht.updateSort,mt=function(e){var t=e.allowAnimations,r=e.sortedRows,i=e.originalRows,a=e.currentPage,l=e.rowsPerPage,c=e.shouldPaginate,u=e.rowGrouping,d=e.rowIdAccessor,f=e.unexpandedRows,h=e.expandAll,v=e.contentHeight,p=e.rowHeight,w=e.scrollTop,x=e.computeFilteredRowsPreview,y=e.computeSortedRowsPreview,b=n.useState(!1),C=b[0],S=b[1],I=n.useState([]),j=I[0],E=I[1],k=n.useRef([]),N=n.useRef([]),F=n.useRef(new Map),A=n.useRef(null),M=n.useCallback(function(e){var n=c?e.slice((a-1)*l,a*l):e;return u&&0!==u.length?m({rows:n,rowGrouping:u,rowIdAccessor:d,unexpandedRows:f,expandAll:h}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[a,l,c,u,d,f,h]);n.useMemo(function(){if(0===F.current.size){var e=M(i),n=new Map;e.forEach(function(e){var t=String(g({row:e.row,rowIdAccessor:d}));n.set(t,e.position)}),F.current=n}},[i,M,d]);var H=n.useMemo(function(){return M(r)},[r,M]),D=n.useMemo(function(){return R({bufferRowCount:5,contentHeight:v,tableRows:H,rowHeight:p,scrollTop:w})},[H,v,p,w]),T=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return String(g({row:e.row,rowIdAccessor:d}))})),r=new Set(n.map(function(e){return String(g({row:e.row,rowIdAccessor:d}))}));return{staying:n.filter(function(e){var n=String(g({row:e.row,rowIdAccessor:d}));return t.has(n)}),entering:n.filter(function(e){var n=String(g({row:e.row,rowIdAccessor:d}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(g({row:e.row,rowIdAccessor:d}));return!r.has(n)})}},[d]),W=n.useMemo(function(){if(0===k.current.length)return!1;var e=H.map(function(e){return String(g({row:e.row,rowIdAccessor:d}))}),n=k.current.map(function(e){return String(g({row:e.row,rowIdAccessor:d}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[H,d]);n.useLayoutEffect(function(){if(!C){if(!t||c)return E([]),k.current=H,void(N.current=D);if(0===k.current.length)return E([]),k.current=H,void(N.current=D);if(!W)return E([]),k.current=H,void(N.current=D);A.current={tableRows:H,visibleRows:D},S(!0)}},[t,H,W,C,c,D]),n.useLayoutEffect(function(){if(C&&A.current&&j.length>0){var e=setTimeout(function(){var e=A.current;S(!1),E([]),k.current=e.tableRows,N.current=e.visibleRows,A.current=null},$.duration+100);return function(){return clearTimeout(e)}}},[C,j.length]);var L=n.useMemo(function(){if(!t||c)return D;if(j.length>0){var e=new Map;return H.forEach(function(n){var t=String(g({row:n.row,rowIdAccessor:d}));e.set(t,n.position)}),j.map(function(n){var t=String(g({row:n.row,rowIdAccessor:d})),r=e.get(t);return void 0!==r?o(o({},n),{position:r}):n})}return D},[D,j,H,t,c,d]),B=n.useCallback(function(e){if(t&&!c){var n=x(e),r=M(n),o=R({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:w}),i=T(D,o).entering.map(function(e){var n=String(g({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(g({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],D,!0),i,!0))}},[t,c,x,M,v,p,w,T,H,D,d]),O=n.useCallback(function(e){if(t&&!c){var n=y(e),r=M(n),o=R({bufferRowCount:5,contentHeight:v,tableRows:r,rowHeight:p,scrollTop:w}),i=T(D,o).entering.map(function(e){var n=String(g({row:e.row,rowIdAccessor:d}));return H.find(function(e){return String(g({row:e.row,rowIdAccessor:d}))===n})||e}).filter(Boolean);i.length>0&&E(s(s([],D,!0),i,!0))}},[t,c,y,M,v,p,w,T,H,D,d]);return{currentTableRows:H,currentVisibleRows:D,isAnimating:C,prepareForFilterChange:B,prepareForSortChange:O,rowsToRender:L}}({allowAnimations:l,sortedRows:pt,originalRows:it,currentPage:hn,rowsPerPage:ke,shouldPaginate:De,rowGrouping:xe,rowIdAccessor:Se,unexpandedRows:Un,expandAll:K,contentHeight:ot,rowHeight:Ce,scrollTop:Yn,computeFilteredRowsPreview:ft,computeSortedRowsPreview:ht.computeSortedRowsPreview}),wt=mt.currentTableRows,xt=mt.rowsToRender,yt=mt.prepareForFilterChange,bt=mt.prepareForSortChange,Ct=mt.isAnimating,St=n.useRef(new Map),It=n.useRef(new Map),Rt=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,s=e.rowIdAccessor,l=e.onCellEdit,c=e.cellRegistry,u=n.useState(new Set),f=u[0],h=u[1],v=n.useState(new Set),p=v[0],m=v[1],x=n.useState(null),y=x[0],b=x[1],C=n.useState(null),S=C[0],I=C[1],R=n.useState(new Set),j=R[0],E=R[1],k=n.useState(new Set),N=k[0],F=k[1],A=n.useRef(!1),M=n.useRef(null),H=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),p.forEach(function(n){e.add(n)}),e},[f,p]),D=n.useMemo(function(){var e=new Set;return f.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),p.size>0&&o.forEach(function(n){var t=g({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[f,p,o,s]),T=n.useMemo(function(){return r.flatMap(d)},[r]),W=n.useCallback(function(){var e=T.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(f).reduce(function(e,t){var r,i=t.split("-").map(Number),a=i[0],s=i[1];e[a]||(e[a]=[]);var l=n.get(s);return l&&(null===(r=o[a])||void 0===r?void 0:r.row)?e[a][s]=o[a].row[l]:e[a][s]="",e},{}),r=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");f.size>0&&(navigator.clipboard.writeText(r),E(new Set(f)),setTimeout(function(){E(new Set)},800))},[T,f,o]),L=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i,u,d,f;return a(this,function(a){switch(a.label){case 0:if(!S)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=T.filter(function(e){return!e.hide}),r=new Set,i=new Set,u=S.rowIndex,d=S.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,a){var f=u+n,h=d+a;if(!(f>=o.length||h>=t.length)){var v=o[f],p=t[h],m=g({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var x=e;if("number"===p.type){var y=Number(e);isNaN(y)||(x=y)}else if("boolean"===p.type)x="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var b=new Date(e);isNaN(b.getTime())||(x=b)}if(v.row[p.accessor]=x,c){var C="".concat(m,"-").concat(p.accessor),S=c.get(C);S&&S.updateContent(x)}null==l||l({accessor:p.accessor,newValue:x,row:v.row,rowIndex:f});var I=w({colIndex:h,rowIndex:f,rowId:m});r.add(I)}else{var R=w({colIndex:h,rowIndex:f,rowId:m});i.add(R)}}})}),r.size>0&&(E(r),setTimeout(function(){E(new Set)},800)),i.size>0&&(F(i),setTimeout(function(){F(new Set)},800)),[3,4]):[2];case 3:return f=a.sent(),console.warn("Failed to paste from clipboard:",f),[3,4];case 4:return[2]}})})},[S,T,o,s,l,c]),B=n.useCallback(function(){if(0!==f.size){var e=T.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,r=new Set;Array.from(f).forEach(function(n){var i=n.split("-").map(Number),a=i[0],u=i[1];if(!(a>=o.length||u>=e.length)){var d=o[a],f=e[u],h=g({row:d.row,rowIdAccessor:s});if(null==f?void 0:f.isEditable){var v=null;if(v="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:Array.isArray(d.row[f.accessor])?[]:""),d.row[f.accessor]=v,c){var p="".concat(h,"-").concat(f.accessor),m=c.get(p);m&&m.updateContent(v)}null==l||l({accessor:f.accessor,newValue:v,row:d.row,rowIndex:a}),t.add(n)}else r.add(n)}}),t.size>0&&(E(t),setTimeout(function(){E(new Set)},800)),r.size>0&&(F(r),setTimeout(function(){F(new Set)},800))}},[f,T,o,s,l,c]),O=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=r;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<o.length){var d=g({row:o[c].row,rowIdAccessor:s});t.add(w({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),b(null),h(t)},[o,s,m,b,h]),P=n.useCallback(function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<T.length){var n=w(e);m(new Set),b(null),h(new Set([n])),I(e)}},[T.length,o.length,m,b,h,I]),q=n.useCallback(function(e,n){void 0===n&&(n=!1),h(new Set),I(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&b(e[e.length-1])},[h,I,m,b]);n.useEffect(function(){var e=function(e){var n;if(t&&S){var r=S.rowIndex,i=S.colIndex,a=S.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void L();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void B();if(g({row:null===(n=o[r])||void 0===n?void 0:n.row,rowIdAccessor:s})!==a){var l=o.findIndex(function(e,n){return g({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;r=l}if("ArrowUp"===e.key){if(e.preventDefault(),r>0){var c=g({row:o[r-1].row,rowIdAccessor:s});P({rowIndex:r-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),r<o.length-1&&(c=g({row:o[r+1].row,rowIdAccessor:s}),P({rowIndex:r+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=g({row:o[r].row,rowIdAccessor:s}),P({rowIndex:r,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<T.length-1&&(c=g({row:o[r].row,rowIdAccessor:s}),P({rowIndex:r,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(h(new Set),m(new Set),b(null),M.current=null,I(null))}else W()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[W,T.length,S,s,O,P,t,o,L,B]);var z=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=w({colIndex:n,rowIndex:t,rowId:r}),i=f.has(o),a=p.has(n);return i||a},[f,p]),Y=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,i=[],a=o[t-1]?g({row:o[t-1].row,rowIdAccessor:s}):null,l=o[t+1]?g({row:o[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:r},f={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!z(c)||p.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!z(u)||p.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),z(d)||i.push("st-selected-left-border"),z(f)||i.push("st-selected-right-border"),i.join(" ")},[z,o,p,s]),G=n.useMemo(function(){return S?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===S.rowIndex&&t===S.colIndex&&r===S.rowId}:function(){return!1}},[S]),K=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=w({colIndex:n,rowIndex:t,rowId:r});return j.has(o)},[j]),U=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=w({colIndex:n,rowIndex:t,rowId:r});return N.has(o)},[N]);return{getBorderClass:Y,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;t&&(A.current=!0,M.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){m(new Set),b(null);var e=w({colIndex:n,rowIndex:r,rowId:o});h(new Set([e])),I({rowIndex:r,colIndex:n,rowId:o})},0))},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&A.current&&M.current){for(var i=new Set,a=Math.min(M.current.rowIndex,r),l=Math.max(M.current.rowIndex,r),c=Math.min(M.current.colIndex,n),u=Math.max(M.current.colIndex,n),d=a;d<=l;d++)for(var f=c;f<=u;f++)if(d>=0&&d<o.length){var v=g({row:o[d].row,rowIdAccessor:s});i.add(w({colIndex:f,rowIndex:d,rowId:v}))}h(i)}},handleMouseUp:function(){A.current=!1},isCopyFlashing:K,isWarningFlashing:U,isInitialFocusedCell:G,isSelected:z,lastSelectedColumnIndex:y,pasteFromClipboard:L,selectColumns:q,selectedCells:f,selectedColumns:p,setInitialFocusedCell:I,setSelectedCells:h,setSelectedColumns:m,deleteSelectedCells:B,columnsWithSelectedCells:H,rowsWithSelectedCells:D}}({selectableCells:Fe,headers:xn,tableRows:wt,rowIdAccessor:Se,onCellEdit:ie,cellRegistry:St.current}),jt=Rt.getBorderClass,Et=Rt.handleMouseDown,kt=Rt.handleMouseOver,Nt=Rt.handleMouseUp,Ft=Rt.isCopyFlashing,At=Rt.isInitialFocusedCell,Mt=Rt.isSelected,Ht=Rt.isWarningFlashing,Dt=Rt.selectColumns,Tt=Rt.selectedCells,Wt=Rt.selectedColumns,Lt=Rt.setInitialFocusedCell,Bt=Rt.setSelectedCells,Ot=Rt.setSelectedColumns,Pt=Rt.columnsWithSelectedCells,qt=Rt.rowsWithSelectedCells,zt=n.useCallback(function(e){bt(e),setTimeout(function(){gt(e)},0)},[bt,gt]),Yt=n.useCallback(function(e){yn(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,s=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(s&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,s,l])}({selectableColumns:Me,selectedCells:Tt,selectedColumns:Wt,setSelectedCells:Bt,setSelectedColumns:Ot,activeHeaderDropdown:kn,setActiveHeaderDropdown:Nn}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){if(t(),r.current){var e=r.current.offsetWidth-r.current.clientWidth;o(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:Je,tableBodyContainerRef:on,setScrollbarWidth:_n}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:ue}),function(e){var t=e.tableRef,r=e.rows,o=e.rowIdAccessor,i=e.cellRegistryRef,a=e.headerRegistryRef;n.useEffect(function(){t&&(t.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,a=e.newValue,s=null==r?void 0:r[t];if(s){var l=g({row:s,rowIdAccessor:o}),c=u({rowId:l,accessor:n}),d=i.current.get(c);d&&d.updateContent(a),void 0!==s[n]&&(s[n]=a)}},setHeaderRename:function(e){var n=e.accessor,t=a.current.get(String(n));t&&t.setEditing(!0)}})},[i,a,r,o,t])}({cellRegistryRef:St,headerRegistryRef:It,rowIdAccessor:Se,rows:Ie,tableRef:Oe}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:st,onFilterChange:ce}),function(e){var t=e.sort,r=e.onSortChange,o=P(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:vt,onSortChange:pe});var Gt=n.useCallback(function(e){yt(e),setTimeout(function(){ct(e)},0)},[yt,ct]);return e.jsx(y,o({value:{allowAnimations:l,areAllRowsSelected:Dn,cellRegistry:St.current,cellUpdateFlash:h,clearSelection:Pn,columnBorders:b,columnReordering:A,columnResizing:H,draggedHeaderRef:$e,editColumns:W,enableHeaderEditing:q,enableRowSelection:Y,expandIcon:V,filters:st,forceUpdate:Je,getBorderClass:jt,handleApplyFilter:Gt,handleClearAllFilters:dt,handleClearFilter:ut,handleMouseDown:Et,handleMouseOver:kt,handleRowSelect:Ln,handleSelectAll:Bn,handleToggleRow:On,headerContainerRef:an,headerRegistry:It.current,headers:qn,hoveredHeaderRef:Qe,isAnimating:Ct,isCopyFlashing:Ft,isInitialFocusedCell:At,isResizing:Cn,isRowSelected:Hn,isScrolling:Rn,isSelected:Mt,isWarningFlashing:Ht,mainBodyRef:nn,nextIcon:oe,onCellEdit:ie,onCellClick:ae,onColumnOrderChange:se,onColumnSelect:le,onLoadMore:fe,onSort:zt,onTableHeaderDragEnd:Yt,pinnedLeftRef:tn,pinnedRightRef:rn,prevIcon:me,rowButtons:we,rowGrouping:xe,rowHeight:Ce,rowIdAccessor:Se,scrollbarWidth:Xn,selectColumns:Dt,selectableColumns:Me,selectedColumns:Wt,columnsWithSelectedCells:Pt,rowsWithSelectedCells:qt,selectedRows:An,selectedRowCount:Tn,selectedRowsData:Wn,setHeaders:yn,setInitialFocusedCell:Lt,setIsResizing:Sn,setIsScrolling:jn,setSelectedCells:Bt,setSelectedColumns:Ot,setSelectedRows:Mn,setUnexpandedRows:Vn,shouldPaginate:De,sortDownIcon:We,sortUpIcon:Be,tableBodyContainerRef:on,tableRows:wt,theme:qe,unexpandedRows:Un,useHoverRowBackground:Ye,useOddColumnBackground:Ve,useOddEvenRowBackground:Ke,headerDropdown:Z,activeHeaderDropdown:kn,setActiveHeaderDropdown:Nn,onHeaderEdit:de}},{children:e.jsx("div",o({className:"simple-table-root st-wrapper theme-".concat(qe," ").concat(null!=v?v:""," ").concat(b?"st-column-borders":""),style:ee?{height:ee}:{}},{children:e.jsx(un,{children:e.jsxs("div",o({className:"st-wrapper-container"},{children:[e.jsx(fn,{}),e.jsxs("div",o({className:"st-content-wrapper",onMouseUp:Nt,onMouseLeave:Nt},{children:[e.jsx(Xe,{pinnedLeftWidth:tt,pinnedRightWidth:rt,setScrollTop:Gn,sort:vt,tableRows:wt,rowsToRender:xt}),e.jsx(sn,{columnEditorText:N,editColumns:W,editColumnsInitOpen:B,headers:xn,position:E})]})),e.jsx(_e,{mainBodyRef:nn,mainBodyWidth:nt,pinnedLeftWidth:tt,pinnedRightWidth:rt,tableBodyContainerRef:on}),e.jsx(C,{currentPage:hn,hideFooter:te,onPageChange:gn,onNextPage:he,shouldPaginate:De,totalPages:Math.ceil(pt.length/ke)})]}))})}))}))};exports.SimpleTable=function(t){var r=n.useState(!1),i=r[0],a=r[1];return n.useEffect(function(){a(!0)},[]),i?e.jsx(wn,o({},t)):null};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,8 +7,10 @@ export declare const handleResizeStart: ({ event, gridColumnEnd, gridColumnStart
|
|
|
7
7
|
/**
|
|
8
8
|
* Recalculate widths for all sections (left, right, main)
|
|
9
9
|
*/
|
|
10
|
-
export declare const recalculateAllSectionWidths: ({ headers, }: {
|
|
10
|
+
export declare const recalculateAllSectionWidths: ({ headers, containerWidth, maxPinnedWidthPercent, }: {
|
|
11
11
|
headers: HeaderObject[];
|
|
12
|
+
containerWidth?: number | undefined;
|
|
13
|
+
maxPinnedWidthPercent?: number | undefined;
|
|
12
14
|
}) => {
|
|
13
15
|
leftWidth: number;
|
|
14
16
|
rightWidth: number;
|
package/package.json
CHANGED