simple-table-core 1.2.3 → 1.2.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,useReducer as v}from"react";var p=function(){return p=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},p.apply(this,arguments)};function g(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 m(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 w(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var y=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},b=function(e){var n=e.header,t=e.pinned;return n.hide?null:!t&&!n.pinned||n.pinned===t||null},C=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},I=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return I(e)}):[e]},x=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(y({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach(function(e){x(e)})},S=function(e){return"number"==typeof e.minWidth?e.minWidth:40},R=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},E=function(e){return e.row[e.rowIdAccessor]},N=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=E({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 R(t)?t:[]}(t,f);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},k=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},F=s(void 0),A=function(n){var t=n.children,r=n.value;return e(F.Provider,p({value:r},{children:t}))},H=function(){var e=u(F);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},T=function(t){var r=t.currentPage,i=t.hideFooter,a=t.onPageChange,l=t.onNextPage,c=t.shouldPaginate,s=t.totalPages,u=H(),d=u.nextIcon,f=u.prevIcon,h=o(!0),v=h[0],w=h[1],y=!(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",p({className:"st-footer"},{children:[e("button",p({className:"st-next-prev-btn ".concat(y?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:y},{children:f})),e("button",p({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return g(void 0,void 0,void 0,function(){var e,n;return m(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 w(!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",p({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",p({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))})]}))},D=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},M=function(n){var t=n.className;return e("svg",p({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},L=function(e){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)},B=function(e){return e.position*(e.rowHeight+1)-1},O=function(e){return e.position*(e.rowHeight+1)},W=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,g=H().mainBodyRef,m=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],I=o({}),x=I[0],S=I[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&m.current?(N(!1),!w.current&&m.current.parentElement&&(w.current=m.current.parentElement),requestAnimationFrame(function(){if(m.current&&w.current){var e,n=m.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==f?void 0:f.current)?f.current.getBoundingClientRect():(null==g?void 0:g.current)?g.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-t.bottom,a=t.top-e.top,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),S(c),N(!0)}})):a||N(!1)},[a,d,f,g,v]),c(function(){var e=function(e){if(a&&m.current){var n=e.target;m.current&&!m.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(m.current&&!m.current.contains(e.target)){var n=m.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",p({ref:m,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:p(p({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},x),{overflow:s})},{children:t})):null},P=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",p({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}))},q=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(W,p({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(P,p({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(P,p({isSelected:!1===u,onClick:function(){return f(!1)}},{children:"False"}))]}))},z=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},Y=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()}})},j=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=H(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],g=h[1],m=o("days"),w=m[0],y=m[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",p({className:"st-datepicker"},{children:[n("div",p({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",p({onClick:function(){g(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",p({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",p({onClick:function(){g(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",p({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",p({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",p({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",p({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);g(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",p({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);g(n),l(n),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},h=1;h<=o;h++)f(h);var m=35-(i+o),w=function(t){n.push(e("div",p({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);g(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(h=1;h<=m;h++)w(h);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",p({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){g(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",p({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){g(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",p({className:"st-datepicker-footer"},{children:e("button",p({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;g(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},G=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},U=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(W,p({open:o,onClose:l,setOpen:i,width:280},{children:e(j,{value:G(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},K=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(W,p({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",p({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(P,p({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},V=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(q,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(U,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(K,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e(Y,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(z,{defaultValue:u,onBlur:s,onChange:o})},J=0,X=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===J||o-J>=r)&&(J=o,n(t))}},$=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.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})},_=Date.now(),ee={screenX:0,screenY:0},ne=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return w(w([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=ne(o.children,n,w(w([],t,!0),[r],!1));if(i)return i}}return null},te=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function re(e,n,t){var r,o,i=Q(e),a=!1;try{var l=te(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=p({},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 oe=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=H().setHeaders,l=$(t);return{handleDragStart:function(e){n.current=e,_=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-ee.screenX,2)+Math.pow(u-ee.screenY,2));r.current=a;var f,h=n.current,v=!1;if(te(h)!==te(a)){f=(I=re(t,h,a)).newHeaders,v=I.emergencyBreak}else{var p=t,g=ne(p,h.accessor),m=ne(p,a.accessor);if(!g||!m)return;var w=g.length,y=m.length,b=m;if(w!==y){var C=y-w;C>0&&(b=m.slice(0,-C))}var I=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 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 x=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(x-_<1500||d<40)||(_=x,ee={screenX:s,screenY:u},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return w([],e,!0)}),null==o||o(t)},10)}}},ie=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},ae={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},le={duration:1e4,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ce={duration:150,easing:"ease-out",delay:0},se=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")},ue=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(){se(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},de=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return g(void 0,void 0,void 0,function(){var e,i,a;return m(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]:ie()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),ie()?p(p({},ce),e):p(p({},"column"===n?ae:le),e)}(t,i?"column":"row"),se(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,ue(n,a,t)]);case 1:return l.sent(),[2]}})})},fe=function(e){var n=e.element,t=e.options;return g(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 m(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,ie()&&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)})])})})},he=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=H(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),g=i(null),m=$(f),w=$(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=g.current;if(!f)if(!m||f)if(!w||u){if(g.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=p(p({},le),{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 x=5*h,S=b-x,R=b+C+x,E=l.y>S&&l.y<R,N=i.y>S&&i.y<R,k=i.y<b,F=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,H=.6*h,T=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&&F){var D=b+C+T(i.y,b,b+C)+A%15*H*2.5+A%7*(.4*h);return void fe({element:v.current,options:{startY:l.y,endY:D,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&k){D=b-T(i.y,b,b+C)-A%15*H*2.5-A%7*(.4*h);return void fe({element:v.current,options:{startY:l.y,endY:D,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+T(l.y,b,b+C)+A%10*H*1;return void fe({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-T(l.y,b,b+C)-A%10*H*1;return void fe({element:v.current,options:{startY:M,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}de({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else g.current=i;else g.current=i}},[s,u,f,o,m,w,h,null==a?void 0:a.position,a]),e("div",p({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};he.displayName="Animate";var ve=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},pe=function(t){var r=t.borderClass,a=t.colIndex,s=t.header,u=t.isHighlighted,d=t.isInitialFocused,f=t.nestedIndex,h=t.rowIndex,v=t.tableRow,g=H(),m=g.cellRegistry,w=g.cellUpdateFlash,b=g.draggedHeaderRef,I=g.expandIcon,x=g.handleMouseDown,S=g.handleMouseOver,N=g.headers,k=g.hoveredHeaderRef,F=g.isCopyFlashing,A=g.isWarningFlashing,T=g.onCellEdit,D=g.onTableHeaderDragEnd,M=g.rowGrouping,L=g.rowIdAccessor,B=g.setUnexpandedRows,O=g.tableBodyContainerRef,W=g.theme,P=g.unexpandedRows,q=g.useOddColumnBackground,z=v.depth,Y=v.row,j=o(Y[s.accessor]),G=j[0],U=j[1],K=o(!1),J=K[0],$=K[1],Q=o(!1),Z=Q[0],_=Q[1],ee=i(null),ne=E({row:Y,rowIdAccessor:L}),te=M&&M[z],re=!!te&&function(e,n){if(!n)return!1;var t=e[n];return R(t)}(Y,te),ie=!P.has(String(ne)),ae=F({rowIndex:h,colIndex:a,rowId:ne}),le=A({rowIndex:h,colIndex:a,rowId:ne}),ce=oe({draggedHeaderRef:b,headers:N,hoveredHeaderRef:k,onTableHeaderDragEnd:D}).handleDragOver,se=X(),ue=y({accessor:s.accessor,rowId:ne}),de=C({rowId:ne,accessor:s.accessor});c(function(){if(m){var e="".concat(ne,"-").concat(s.accessor);return m.set(e,{updateContent:function(e){G!==e?(U(e),w&&(_(!0),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(function(){_(!1)},800))):U(e)}}),function(){m.delete(e),ee.current&&clearTimeout(ee.current)}}},[m,w,ne,s.accessor,G]),c(function(){if(Z){var e=setTimeout(function(){_(!1)},850);return function(){return clearTimeout(e)}}},[Z]),c(function(){U(Y[s.accessor])},[Y,s.accessor]);var fe="boolean"===s.type||"date"===s.type||"enum"===s.type,pe=Boolean(null==s?void 0:s.isEditable),ge="st-cell ".concat(z>0&&s.expandable?"st-cell-depth-".concat(z):""," ").concat(u?d?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(pe?"clickable":""," ").concat(Z?d?"st-cell-updating-first":"st-cell-updating":""," ").concat(ae?d?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(le?d?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(q?f%2==0?"even-column":"odd-column":""),me=l(function(e){U(e),Y[s.accessor]=e,null==T||T({accessor:s.accessor,newValue:e,row:Y,rowIndex:h})},[s.accessor,T,Y,h]),we=l(function(){B(function(e){var n=new Set(e),t=String(ne);return n.has(t)?n.delete(t):n.add(t),n})},[ne,B]);return J&&!fe?e("div",p({className:"st-cell-editing",id:y({accessor:s.accessor,rowId:ne}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(V,{enumOptions:s.enumOptions,onChange:me,setIsEditing:$,type:s.type,value:G})})):n(he,p({className:ge,"data-accessor":s.accessor,"data-col-index":a,"data-row-id":ne,"data-row-index":h,id:ue,onDoubleClick:function(){return s.isEditable&&$(!0)},onDragOver:function(e){return se({callback:ce,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){J||"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||J||(e.preventDefault(),$(!0))},onMouseDown:function(){J||x({rowIndex:h,colIndex:a,rowId:ne})},onMouseOver:function(){J||S({rowIndex:h,colIndex:a,rowId:ne})},parentRef:O,tableRow:v},{children:[s.expandable&&re?e("div",p({className:"st-icon-container st-expand-icon-container ".concat(ie?"expanded":"collapsed"),onClick:we},{children:I})):null,e("span",p({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"left-aligned")},{children:e("span",{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:a,row:Y,theme:W}):ve({content:G,header:s})})})),J&&fe&&e(V,{enumOptions:s.enumOptions,onChange:me,setIsEditing:$,type:s.type,value:G})]}),de)},ge=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=H().rowIdAccessor,d=i.filter(function(e){return b({header:e,pinned:a})});return e(t,{children:d.map(function(n,t){var d=E({row:s.row,rowIdAccessor:u}),f=y({accessor:n.accessor,rowId:d});return e(me,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},me=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=H(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,m=E({row:s.row,rowIdAccessor:g});if(r.children){var w=r.children.filter(function(e){return b({header:e,pinned:a})});return e(f,{children:w.map(function(n){var r=y({accessor:n.accessor,rowId:m});return e(me,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var C={rowIndex:l,colIndex:u,rowId:m},I=h(C),x=v(C),S=p(C),R=y({accessor:r.accessor,rowId:m});return e(pe,{borderClass:I,colIndex:u,header:r,isHighlighted:x,isInitialFocused:S,nestedIndex:i,rowIndex:l,tableRow:s},R)},we=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=H(),v=h.useHoverRowBackground,g=h.rowIdAccessor,m=h.isAnimating,w=f.position,y=w%2==0,b=E({row:f.row,rowIdAccessor:g});return e("div",p({className:"st-row ".concat(y?"even":"odd"," ").concat(a===l&&v?"hovered":""),onMouseEnter:function(){m||d(l)},style:{gridTemplateColumns:o,top:O({position:w,rowHeight:s}),height:"".concat(s,"px")}},{children:e(ge,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:w,rowIndices:u,tableRow:f},b)}))},ye=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",p({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:B({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},be=s(void 0),Ce=["default"],Ie=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(be);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,Ce),function(){n.current&&i(n.current,Ce)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},xe=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},Se=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,l=t.hoveredIndex,c=t.pinned,s=t.ref,u=t.rowHeight,d=t.rowIndices,h=t.setHoveredIndex,v=t.templateColumns,g=t.totalHeight,m=t.rowsToRender,w=t.width,y=c?"st-body-pinned-".concat(c):"st-body-main",b=H().rowIdAccessor;return a(function(){return Z(i,c)},[i,c])?e(xe,p({condition:!c,wrapper:function(n){return e(Ie,p({childRef:s},{children:n}))}},{children:e("div",p({className:y,ref:s,style:p({position:"relative",height:"".concat(g,"px"),width:w},!c&&{flexGrow:1})},{children:m.map(function(t,a){var s=E({row:t.row,rowIdAccessor:b});return n(f,{children:[0!==a&&e(ye,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:u,templateColumns:v,rowIndex:a-1}),e(we,{columnIndexStart:r,columnIndices:o,gridTemplateColumns:v,headers:i,hoveredIndex:l,index:a,pinned:c,rowHeight:u,rowIndices:d,setHoveredIndex:h,tableRow:t},s)]},s)})}))})):null};function Re(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 b({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&&b({header:e})}).forEach(function(e,n){var r=0===n&&0===t.length;a(e,r)}),r.forEach(function(e){a(e,!1)}),o}var Ee=function(t){var r=t.mainTemplateColumns,s=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,d=t.pinnedLeftWidth,f=t.pinnedRightColumns,h=t.pinnedRightTemplateColumns,v=t.pinnedRightWidth,g=t.rowsToRender,m=t.setScrollTop,w=t.tableRows,y=H(),b=y.headerContainerRef,C=y.headers,I=y.isAnimating,x=y.mainBodyRef,S=y.onLoadMore,R=y.rowHeight,N=y.rowIdAccessor,k=y.scrollbarWidth,F=y.setIsScrolling,A=y.shouldPaginate,T=y.tableBodyContainerRef,D=o(null),M=D[0],L=D[1],B=o(!1),O=B[0],W=B[1];c(function(){I&&null!==M&&L(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:T,scrollbarWidth:k}),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}(w),j=Y*(R+1)-1,G=a(function(){return Re({headers:C,pinnedLeftColumns:s,pinnedRightColumns:f})},[C,s,f]),U=a(function(){var e={};return g.forEach(function(n,t){var r=String(E({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[g,N]),K=l(function(e,n){if(S&&!A&&!O){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(W(!0),S(),setTimeout(function(){W(!1)},1e3))}},[S,A,O]),V={columnIndices:G,headerContainerRef:b,headers:C,hoveredIndex:M,rowHeight:R,rowIndices:U,rowsToRender:g,setHoveredIndex:L};return n("div",p({className:"st-body-container",onMouseLeave:function(){return L(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;F(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){F(!1)},150),P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){m(t),K(n,t),z.current=t})},ref:T},{children:[e(Se,p({},V,{pinned:"left",templateColumns:u,totalHeight:j,width:d})),e(Se,p({},V,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:j})),e(Se,p({},V,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:j,width:v}))]}))},Ne=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,Ne(e.children)),n})},ke=function(e){return void 0===e&&(e=0),e?e+1:0},Fe=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=S(o),f=t-r>1,h=f?I(o):[o],v=function(e){var n="right"===o.pinned?s-e:e-s;if(f&&h.length>1)Ae({delta:n,leafHeaders:h,minWidth:d,startWidth:c});else{var t=Math.max(c+n,d);o.width=t}i.forEach(function(e){x(e)});var r=w([],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 m=function(e){v(e.clientX)},y=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",y),l(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",y)}}},Ae=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,S(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})},He=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=I(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(y({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:ke(t),rightWidth:ke(r),mainWidth:o}},Te=function(n){var t=n.className,r=n.style;return e("svg",p({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:p({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"})}))},De={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"},Me=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"]}},Le=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Be=function(e){return["between","notBetween","in","notIn"].includes(e)},Oe=function(e){return["isEmpty","isNotEmpty"].includes(e)},We=function(n){var t=n.children;return e("div",p({className:"st-filter-container"},{children:t}))},Pe=function(){return e("svg",p({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"})}))},qe=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,g=o(!1),m=g[0],w=g[1],y=o(-1),b=y[0],C=y[1],I=i(null),x=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(m)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(m)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[m,b,l,a]);return n("div",p({ref:I,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(m?"st-custom-select-open":"").trim()},{children:[n("button",p({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!m),m)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":m,"aria-labelledby":"select-label"},{children:[e("span",p({className:"st-custom-select-value"},{children:x?x.label:u})),e(Pe,{})]})),e(W,p({open:m,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",p({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",p({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},ze=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:De[e]}});return e("div",p({className:"st-filter-section"},{children:e(qe,{value:t,onChange:function(e){r(e)},options:o})}))},Ye=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",p({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ge=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",p({className:"st-filter-actions"},{children:[e("button",p({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",p({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Ue=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],g=Me("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var m=function(){var e=p({accessor:r.accessor,operator:u},Le(u)&&{value:h});a(e)},w=Oe(u)||h.trim();return n(We,{children:[e(ze,{value:u,onChange:d,operators:g}),Le(u)&&e(je,{children:e(Ye,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:m})}),e(Ge,{onApply:m,onClear:l,canApply:!!w,showClear:!!i})]})},Ke=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],m=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=m[0],y=m[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],I=b[1],x=Me("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 S=function(){var e={accessor:a.accessor,operator:f};Le(f)?e.value=parseFloat(p):Be(f)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)};return n(We,{children:[e(ze,{value:f,onChange:h,operators:x}),Le(f)&&e(je,{children:e(Ye,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:S})}),Be(f)&&n(je,{children:[e(Ye,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:S}),e(Ye,{type:"number",value:C,onChange:I,placeholder:"To...",onEnterPress:S})]}),e(Ge,{onApply:S,onClear:u,canApply:!!Oe(f)||(Le(f)?""!==p.trim():!!Be(f)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},Ve=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(qe,{value:t,onChange:r,options:o,className:a,placeholder:l})},Je=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=Me("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Oe(u)||""!==h;return n(We,{children:[e(ze,{value:u,onChange:d,operators:p}),Le(u)&&e(je,{children:e(Ve,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ge,{onApply:function(){var e={accessor:r.accessor,operator:u};Le(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},Xe=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],g=o((null==s?void 0:s.value)?String(s.value):""),m=g[0],w=g[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])||"")),x=I[0],S=I[1],R=Me("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),S(""))},[s]);var 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(""),g=v[0],m=v[1],w=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||m(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else m("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",p({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:g,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(W,p({open:f,setOpen:h,onClose:function(){h(!1)},positioning:"absolute",overflow:"visible"},{children:e(j,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),h(!1)},onClose:function(){return h(!1)}})}))]}))};return n(We,{children:[e(ze,{value:h,onChange:v,operators:R}),Le(h)&&e(je,{children:e(E,{value:m,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Be(h)&&n(je,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:x,onChange:S,placeholder:"To date..."})]}),e(Ge,{onApply:function(){var e={accessor:l.accessor,operator:h};Le(h)?e.value=m:Be(h)&&(e.values=[b,x]),u(e)},onClear:d,canApply:!!Oe(h)||(Le(h)?""!==m.trim():!!Be(h)&&""!==b.trim()&&""!==x.trim()),showClear:!!s})]})},$e=function(n){var t=n.className,r=n.style;return e("svg",p({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:p({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"})}))},Qe=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",p({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",p({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e($e,{className:"st-checkbox-checkmark"})})),i]}))},Ze=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 g=h.length===d.length;return n(We,{children:[e(je,{children:n("div",p({className:"st-enum-filter-options"},{children:[e("div",p({className:"st-enum-select-all"},{children:e(Qe,p({checked:g,onChange:function(e){v(e?d:[])}},{children:e("span",p({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(Qe,p({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}):w(w([],n,!0),[e],!1)});var e}},{children:e("span",p({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Ge,{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})]})},_e=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(Ke,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(Je,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(Xe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Ue,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},en=function(t){var r,i,a=t.colIndex,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,d=t.gridRowStart,f=t.header,h=t.reverse,v=t.sort,g=o(!1),m=g[0],b=g[1],C=H(),I=C.columnReordering,x=C.columnResizing,S=C.draggedHeaderRef,R=C.filters,E=C.handleApplyFilter,N=C.handleClearFilter,k=C.headers,F=C.hoveredHeaderRef,A=C.onColumnOrderChange,T=C.onSort,D=C.onTableHeaderDragEnd,M=C.rowHeight,L=C.selectColumns,B=C.selectableColumns,O=C.setHeaders,P=C.setInitialFocusedCell,q=C.setIsResizing,z=C.setSelectedCells,Y=C.setSelectedColumns,j=C.sortDownIcon,G=C.sortUpIcon,U=Boolean(null==f?void 0:f.isSortable),K=Boolean(null==f?void 0:f.filterable),V=R[f.accessor],J="st-header-cell ".concat(f.accessor===(null===(r=F.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=S.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(U?"clickable":""," ").concat(I&&!U?"columnReordering":""," ").concat(f.children?"parent":""),$=oe({draggedHeaderRef:S,headers:k,hoveredHeaderRef:F,onColumnOrderChange:A,onTableHeaderDragEnd:D}),Q=$.handleDragStart,Z=$.handleDragEnd,_=$.handleDragOver,ee=X(),ne=function(e){var n=e.event,t=e.header;if(B){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t}(t,a);return n.shiftKey&&L?Y(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=w(w([],(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(w(w([],Array.from(e),!0),u,!0))}):L&&L(r),z(new Set),void P(null)}t.isSortable&&T(t.accessor)};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!f)return null;var te=x&&e("div",p({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(y({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;ee({callback:Fe,callbackProps:{event:e.nativeEvent,gridColumnEnd:l,gridColumnStart:s,header:f,headers:k,setHeaders:O,setIsResizing:q,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(y({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;ee({callback:Fe,callbackProps:{event:e,gridColumnEnd:l,gridColumnStart:s,header:f,headers:k,setHeaders:O,setIsResizing:q,startWidth:t},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),re=v&&v.key.accessor===f.accessor&&n("div",p({className:"st-icon-container",onClick:function(e){return ne({event:e,header:f})}},{children:["ascending"===v.direction&&G&&G,"descending"===v.direction&&j&&j]})),ie=K&&n("div",p({className:"st-icon-container",onClick:function(e){e.stopPropagation(),b(!m)}},{children:[e(Te,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(W,p({open:m,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e(_e,{header:f,currentFilter:V,onApplyFilter:function(e){E(e),b(!1)},onClearFilter:function(){N(f.accessor),b(!1)}})}))]}));return n(he,p({className:J,id:y({accessor:f.accessor,rowId:"header"}),onDragOver:function(e){ee({callback:_,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:p(p({gridRowStart:d,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-d>1?{}:{height:M})},{children:[h&&te,"right"===f.align&&ie,"right"===f.align&&re,e("div",p({className:"st-header-label",draggable:I&&!f.disableReorder,onClick:function(e){return ne({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),Z()},onDragStart:function(e){I&&f&&function(e){Q(e)}(f)}},{children:e("span",p({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:a,header:f}):null==f?void 0:f.label}))})),"right"!==f.align&&re,"right"!==f.align&&ie,!h&&te]}))},nn=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),!b({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 b({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){b({header:e,pinned:s})&&(t(e,i+1,g),g=!1)})}return h-f},o=l.filter(function(e){return b({header:e,pinned:s})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r]);return e(xe,p({condition:!s,wrapper:function(n){return e(Ie,p({childRef:u},{children:n}))}},{children:e("div",p({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(en,{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)})})}))}))},tn=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(tn)):1},rn=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=H(),g=v.headerContainerRef,m=v.pinnedLeftRef,w=v.pinnedRightRef,y=a(function(){return Re({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s})},[o,l,s]),C=a(function(){var e=0;return o.forEach(function(n){if(b({header:n})){var t=tn(n);e=Math.max(e,t)}}),{maxDepth:e}},[o]).maxDepth;return n("div",p({className:"st-header-container",ref:g},{children:[Z(o,"left")&&e(nn,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:C,pinned:"left",sectionRef:m,sort:d,width:f}),e(nn,{columnIndices:y,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:C,sectionRef:r,sort:d}),Z(o,"right")&&e(nn,{columnIndices:y,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:C,pinned:"right",sectionRef:w,sort:d,width:h})]}))},on=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(" "))},an=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=H(),f=d.columnResizing,h=d.editColumns,v=d.headers,g=i(null),m=v.filter(function(e){return!e.pinned}),w=v.filter(function(e){return"left"===e.pinned}),y=v.filter(function(e){return"right"===e.pinned}),b=a(function(){return on({headers:w})},[w]),C=a(function(){return on({headers:m})},[m]),I=a(function(){return on({headers:y})},[y]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:C,pinnedLeftColumns:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:y,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},S={tableRows:s,mainTemplateColumns:C,pinnedLeftColumns:w,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:y,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",p({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(rn,p({},x)),e(Ee,p({},S))]}))},ln=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=H().editColumns,v=o(!1),g=v[0],m=v[1],w=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;m(l>e)}}()},1)},[s,l]),g?n("div",p({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Ie,p({childRef:w},{children:e("div",p({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},cn={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 cn.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?cn.string(e,n,t):"number"==typeof e&&"number"==typeof n?cn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?cn.boolean(e,n,t):cn.string(String(e),String(n),t)}},sn=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 w([],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 cn.number(i,a,r)}return"date"===t?cn.date(String(e),String(n),r):"boolean"===t?cn.boolean(Boolean(e),Boolean(n),r):"enum"===t?cn.enum(String(e),String(n),r):cn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},un=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return sn({rows:t,sortColumn:r,headers:n})},dn=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}):un({headers:i,rows:t,sortColumn:r}):t},fn=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(fn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},hn=function(e){return e.every(function(e){return e.hide})},vn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(vn(e.children),hn(e.children)&&(e.hide=!0))})},pn=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=H(),g=v.expandIcon,m=v.headers,y=v.setHeaders,b=c?"".concat(16*l,"px"):"8px",C=s.children&&s.children.length>0,I=null!=u?u:s.hide||C&&s.children&&hn(s.children);return n(t,{children:[n("div",p({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[c&&e("div",p({className:"st-header-icon-container"},{children:C?e("div",p({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:g})):null})),e(Qe,p({checked:I,onChange:function(e){(s.hide=e,e)?vn(i):(fn(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,fn(i,s.children[0].accessor)));y(w([],m,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",p({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(pn,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!I||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},gn=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",p({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",p({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return e(pn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},mn=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",p({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",p({className:"st-column-editor-text"},{children:r})),e(gn,{headers:l,open:d,position:s})]})):null},wn=function(n){var t=n.className;return e("svg",p({"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"})}))},yn=function(n){var t=n.className;return e("svg",p({"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"})}))},bn=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(be.Provider,p({value:{registerPane:d,unregisterPane:f}},{children:r.Children.only(t)}))},Cn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=De[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)},In=function(){var t=H(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",p({className:"st-filter-bar"},{children:e("div",p({className:"st-filter-bar-content"},{children:e("div",p({className:"st-filter-chips"},{children:a.map(function(t){return n("div",p({className:"st-filter-chip"},{children:[e("span",p({className:"st-filter-chip-text"},{children:Cn(t,i)})),e("button",p({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},xn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},Sn=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=xn(h),g=xn(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 xn(new Date(String(e||"")))}),w=m[0],y=m[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return xn(new Date(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(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 x=String(e),S=o.includes(x);return"in"===t?S:!S}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},Rn=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 Ne(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&&R(l)){var c=i(l,t+1),s=p({},n);return s[o]=c,e.forEach(function(e){var n=En(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},En=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&R(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}},Nn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(kn,p({},n)):null},kn=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.columnEditorPosition,y=void 0===h?"right":h,b=t.columnEditorText,x=void 0===b?"Columns":b,S=t.columnReordering,F=void 0!==S&&S,H=t.columnResizing,B=void 0!==H&&H,O=t.defaultHeaders,W=t.editColumns,P=void 0!==W&&W,q=t.editColumnsInitOpen,z=void 0!==q&&q,Y=t.expandAll,j=void 0===Y||Y,G=t.expandIcon,U=void 0===G?e(M,{className:"st-expand-icon"}):G,K=t.externalFilterHandling,V=void 0!==K&&K,J=t.externalSortHandling,X=void 0!==J&&J,Q=t.height,Z=t.hideFooter,_=void 0!==Z&&Z,ee=t.nextIcon,ne=void 0===ee?e(M,{className:"st-next-prev-icon"}):ee,te=t.onCellEdit,re=t.onColumnOrderChange,oe=t.onFilterChange,ie=t.onGridReady,ae=t.onLoadMore,ce=t.onNextPage,se=t.onSortChange,ue=t.prevIcon,de=void 0===ue?e(D,{className:"st-next-prev-icon"}):ue,fe=t.rowGrouping,he=t.rowHeight,ve=void 0===he?32:he,pe=t.rowIdAccessor,ge=t.rows,me=t.rowsPerPage,we=void 0===me?10:me,ye=t.selectableCells,be=void 0!==ye&&ye,Ce=t.selectableColumns,Ie=void 0!==Ce&&Ce,xe=t.shouldPaginate,Se=void 0!==xe&&xe,Re=t.sortDownIcon,Ee=void 0===Re?e(wn,{className:"st-header-icon"}):Re,Ne=t.sortUpIcon,ke=void 0===Ne?e(yn,{className:"st-header-icon"}):Ne,Fe=t.tableRef,Ae=t.theme,Te=void 0===Ae?"light":Ae,De=t.useHoverRowBackground,Me=void 0===De||De,Le=t.useOddEvenRowBackground,Be=void 0===Le||Le,Oe=t.useOddColumnBackground,We=void 0!==Oe&&Oe;We&&(Be=!1);var Pe=v(function(e){return e+1},0)[1],qe=i(null),ze=i(null),Ye=i(null),je=i(null),Ge=i(null),Ue=i(null),Ke=i(null),Ve=o(1),Je=Ve[0],Xe=Ve[1],$e=o(O),Qe=$e[0],Ze=$e[1],_e=o(!1),en=_e[0],nn=_e[1],tn=o(!1),rn=tn[0],on=tn[1];c(function(){Ze(O)},[O]);var cn=o(0),sn=cn[0],fn=cn[1],hn=o(new Set),vn=hn[0],pn=hn[1],gn=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:Ue}),Cn=gn.scrollbarWidth,xn=gn.setScrollbarWidth,En=a(function(){var e=He({headers:Qe});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Qe]),Nn=En.mainBodyWidth,kn=En.pinnedLeftWidth,Fn=En.pinnedRightWidth,An=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:Q,rowHeight:ve}),Hn=Rn({rows:ge,headers:Qe,rowGrouping:fe}),Tn=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Sn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=p(p({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=p({},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=p(p({},c),((r={})[e.accessor]=e,r));return Sn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:Hn,externalFilterHandling:V,onFilterChange:oe}),Dn=Tn.filters,Mn=Tn.filteredRows,Ln=Tn.updateFilter,Bn=Tn.clearFilter,On=Tn.clearAllFilters,Wn=Tn.computeFilteredRowsPreview,Pn=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=un({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(R(a)){var l=f({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return p(p({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return dn({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]),g=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"},dn({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:g}}({headers:Qe,tableRows:Mn,externalSortHandling:X,onSortChange:se,rowGrouping:fe}),qn=Pn.sort,zn=Pn.sortedRows,Yn=Pn.updateSort,jn=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,g=e.expandAll,m=e.contentHeight,y=e.rowHeight,b=e.scrollTop,C=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,x=o(!1),S=x[0],R=x[1],k=o([]),F=k[0],A=k[1],H=i([]),T=i([]),D=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?N({rows:n,rowGrouping:f,rowIdAccessor:h,unexpandedRows:v,expandAll:g}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,f,h,v,g]);a(function(){if(0===D.current.size){var e=B(r),n=new Map;e.forEach(function(e){var t=String(E({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),D.current=n}},[r,B,h]);var O=a(function(){return B(t)},[t,B]),W=a(function(){return L({bufferRowCount:5,contentHeight:m,tableRows:O,rowHeight:y,scrollTop:b})},[O,m,y,b]),P=l(function(e,n){var t=new Set(e.map(function(e){return String(E({row:e.row,rowIdAccessor:h}))})),r=new Set(n.map(function(e){return String(E({row:e.row,rowIdAccessor:h}))}));return{staying:n.filter(function(e){var n=String(E({row:e.row,rowIdAccessor:h}));return t.has(n)}),entering:n.filter(function(e){var n=String(E({row:e.row,rowIdAccessor:h}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(E({row:e.row,rowIdAccessor:h}));return!r.has(n)})}},[h]),q=a(function(){if(0===H.current.length)return!1;var e=O.map(function(e){return String(E({row:e.row,rowIdAccessor:h}))}),n=H.current.map(function(e){return String(E({row:e.row,rowIdAccessor:h}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[O,h]);d(function(){if(!S){if(!n||u)return A([]),H.current=O,void(T.current=W);if(0===H.current.length)return A([]),H.current=O,void(T.current=W);if(!q)return A([]),H.current=O,void(T.current=W);M.current={tableRows:O,visibleRows:W},R(!0)}},[n,O,q,S,u,W]),d(function(){if(S&&M.current&&F.length>0){var e=setTimeout(function(){var e=M.current;R(!1),A([]),H.current=e.tableRows,T.current=e.visibleRows,M.current=null},le.duration+100);return function(){return clearTimeout(e)}}},[S,F.length]);var z=a(function(){if(!n||u)return W;if(F.length>0){var e=new Map;return O.forEach(function(n){var t=String(E({row:n.row,rowIdAccessor:h}));e.set(t,n.position)}),F.map(function(n){var t=String(E({row:n.row,rowIdAccessor:h})),r=e.get(t);return void 0!==r?p(p({},n),{position:r}):n})}return W},[W,F,O,n,u,h]),Y=l(function(e){if(n&&!u){var t=C(e),r=B(t),o=L({bufferRowCount:5,contentHeight:m,tableRows:r,rowHeight:y,scrollTop:b}),i=P(W,o).entering.map(function(e){var n=String(E({row:e.row,rowIdAccessor:h}));return O.find(function(e){return String(E({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&A(w(w([],W,!0),i,!0))}},[n,u,C,B,m,y,b,P,O,W,h]),j=l(function(e){if(n&&!u){var t=I(e),r=B(t),o=L({bufferRowCount:5,contentHeight:m,tableRows:r,rowHeight:y,scrollTop:b}),i=P(W,o).entering.map(function(e){var n=String(E({row:e.row,rowIdAccessor:h}));return O.find(function(e){return String(E({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&A(w(w([],W,!0),i,!0))}},[n,u,I,B,m,y,b,P,O,W,h]);return{currentTableRows:O,currentVisibleRows:W,isAnimating:S,prepareForFilterChange:Y,prepareForSortChange:j,rowsToRender:z}}({allowAnimations:s,sortedRows:zn,originalRows:Hn,currentPage:Je,rowsPerPage:we,shouldPaginate:Se,rowGrouping:fe,rowIdAccessor:pe,unexpandedRows:vn,expandAll:j,contentHeight:An,rowHeight:ve,scrollTop:sn,computeFilteredRowsPreview:Wn,computeSortedRowsPreview:Pn.computeSortedRowsPreview}),Gn=jn.currentTableRows,Un=jn.rowsToRender,Kn=jn.prepareForFilterChange,Vn=jn.prepareForSortChange,Jn=jn.isAnimating,Xn=i(new Map),$n=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),w=p[0],y=p[1],b=o(null),C=b[0],x=b[1],S=o(null),R=S[0],N=S[1],F=o(new Set),A=F[0],H=F[1],T=o(new Set),D=T[0],M=T[1],L=i(!1),B=i(null),O=a(function(){return t.flatMap(I)},[t]),W=l(function(){var e=O.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))},[O,h,r]),P=l(function(){return g(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return m(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=O.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=E({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(m=y)}if(v.row[p.accessor]=m,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(m)}null==u||u({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var I=k({colIndex:h,rowIndex:f,rowId:g});o.add(I)}else{var x=k({colIndex:h,rowIndex:f,rowId:g});i.add(x)}}})}),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,O,r,s,u,d]),q=l(function(){if(0!==h.size){var e=O.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=E({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,O,r,s,u,d]),z=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=E({row:r[c].row,rowIdAccessor:s});t.add(k({colIndex:u,rowIndex:c,rowId:d}))}y(new Set),x(null),v(t)},[r,s,y,x,v]),Y=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<O.length){var n=k(e);y(new Set),x(null),v(new Set([n])),N(e)}},[O.length,r.length,y,x,v,N]),j=l(function(e,n){void 0===n&&(n=!1),v(new Set),N(null),y(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&x(e[e.length-1])},[v,N,y,x]);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 P();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void q();if(E({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return E({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=E({row:r[o-1].row,rowIdAccessor:s});Y({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=E({row:r[o+1].row,rowIdAccessor:s}),Y({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=E({row:r[o].row,rowIdAccessor:s}),Y({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<O.length-1&&(c=E({row:r[o].row,rowIdAccessor:s}),Y({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),y(new Set),x(null),B.current=null,N(null))}else W()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[W,O.length,R,s,z,Y,n,r,P,q]);var G=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r}),i=h.has(o),a=w.has(n);return i||a},[h,w]),U=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?E({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?E({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||!G(c)||w.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!G(u)||w.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),G(d)||i.push("st-selected-left-border"),G(f)||i.push("st-selected-right-border"),i.join(" ")},[G,r,w,s]),K=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]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r});return A.has(o)},[A]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=k({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]);return{getBorderClass:U,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(L.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){y(new Set),x(null);var e=k({colIndex:t,rowIndex:r,rowId:o});v(new Set([e])),N({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&L.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=E({row:r[d].row,rowIdAccessor:s});i.add(k({colIndex:f,rowIndex:d,rowId:h}))}v(i)}},handleMouseUp:function(){L.current=!1},isCopyFlashing:V,isWarningFlashing:J,isInitialFocusedCell:K,isSelected:G,lastSelectedColumnIndex:C,pasteFromClipboard:P,selectColumns:j,selectedCells:h,selectedColumns:w,setInitialFocusedCell:N,setSelectedCells:v,setSelectedColumns:y,deleteSelectedCells:q}}({selectableCells:be,headers:Qe,tableRows:Gn,rowIdAccessor:pe,onCellEdit:te,cellRegistry:Xn.current}),Qn=$n.getBorderClass,Zn=$n.handleMouseDown,_n=$n.handleMouseOver,et=$n.handleMouseUp,nt=$n.isCopyFlashing,tt=$n.isInitialFocusedCell,rt=$n.isSelected,ot=$n.isWarningFlashing,it=$n.selectColumns,at=$n.selectedCells,lt=$n.selectedColumns,ct=$n.setInitialFocusedCell,st=$n.setSelectedCells,ut=$n.setSelectedColumns,dt=l(function(e){Vn(e),setTimeout(function(){Yn(e)},0)},[Vn,Yn]),ft=l(function(e){Ze(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns;c(function(){var e=function(e){var a=e.target;a.closest(".st-cell")||n&&(a.classList.contains("st-header-cell")||a.classList.contains("st-header-label"))||(t.size>0&&o(new Set),r.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i])}({selectableColumns:Ie,selectedCells:at,selectedColumns:lt,setSelectedCells:st,setSelectedColumns:ut}),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:Pe,tableBodyContainerRef:Ue,setScrollbarWidth:xn}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:ie}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef;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=E({row:l,rowIdAccessor:r}),s=C({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}}})},[o,t,r,n])}({cellRegistryRef:Xn,rowIdAccessor:pe,rows:ge,tableRef:Fe}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Dn,onFilterChange:oe}),function(e){var n=e.sort,t=e.onSortChange,r=$(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:qn,onSortChange:se});var ht=l(function(e){Kn(e),setTimeout(function(){Ln(e)},0)},[Kn,Ln]);return e(A,p({value:{allowAnimations:s,cellRegistry:Xn.current,cellUpdateFlash:f,columnReordering:F,columnResizing:B,draggedHeaderRef:qe,editColumns:P,expandIcon:U,filters:Dn,forceUpdate:Pe,getBorderClass:Qn,handleApplyFilter:ht,handleClearAllFilters:On,handleClearFilter:Bn,handleMouseDown:Zn,handleMouseOver:_n,headerContainerRef:Ke,headers:Qe,hoveredHeaderRef:ze,isAnimating:Jn,isCopyFlashing:nt,isInitialFocusedCell:tt,isResizing:en,isScrolling:rn,isSelected:rt,isWarningFlashing:ot,mainBodyRef:Ye,nextIcon:ne,onCellEdit:te,onColumnOrderChange:re,onLoadMore:ae,onSort:dt,onTableHeaderDragEnd:ft,pinnedLeftRef:je,pinnedRightRef:Ge,prevIcon:de,rowGrouping:fe,rowHeight:ve,rowIdAccessor:pe,scrollbarWidth:Cn,selectColumns:it,selectableColumns:Ie,setHeaders:Ze,setInitialFocusedCell:ct,setIsResizing:nn,setIsScrolling:on,setSelectedCells:st,setSelectedColumns:ut,setUnexpandedRows:pn,shouldPaginate:Se,sortDownIcon:Ee,sortUpIcon:ke,tableBodyContainerRef:Ue,tableRows:Gn,theme:Te,unexpandedRows:vn,useHoverRowBackground:Me,useOddColumnBackground:We,useOddEvenRowBackground:Be}},{children:e("div",p({className:"simple-table-root st-wrapper theme-".concat(Te),style:Q?{height:Q}:{}},{children:e(bn,{children:n("div",p({className:"st-wrapper-container"},{children:[e(In,{}),n("div",p({className:"st-content-wrapper",onMouseUp:et,onMouseLeave:et},{children:[e(an,{pinnedLeftWidth:kn,pinnedRightWidth:Fn,setScrollTop:fn,sort:qn,tableRows:Gn,rowsToRender:Un}),e(mn,{columnEditorText:x,editColumns:P,editColumnsInitOpen:z,headers:Qe,position:y})]})),e(ln,{mainBodyRef:Ye,mainBodyWidth:Nn,pinnedLeftWidth:kn,pinnedRightWidth:Fn,tableBodyContainerRef:Ue}),e(T,{currentPage:Je,hideFooter:_,onPageChange:Xe,onNextPage:ce,shouldPaginate:Se,totalPages:Math.ceil(zn.length/we)})]}))})}))}))};export{Nn 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 m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function w(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function y(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.accessor,t=e.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},x=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},S=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap(function(e){return S(e)}):[e]},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]},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=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},A=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},H=s(void 0),T=function(n){var t=n.children,r=n.value;return e(H.Provider,m({value:r},{children:t}))},D=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=D(),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",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(g?"disabled":""),onClick:function(){var e=r-1;e>=1&&a(e)},disabled:g},{children:f})),e("button",m({className:"st-next-prev-btn ".concat(b?"disabled":""),onClick:function(){return w(void 0,void 0,void 0,function(){var e,n;return y(this,function(t){switch(t.label){case 0:return e=r===s,n=r+1,l&&e?[4,l(r)]:[3,2];case 1:if(!t.sent())return p(!1),[2];t.label=2;case 2:return(n<=s||l)&&a(n),[2]}})})},disabled:b},{children:d})),C.map(function(n,t){return n<0?e("span",m({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",m({onClick:function(){return function(e){e>=1&&e<=s&&a(e)}(n)},className:"st-page-btn ".concat(r===n?"active":"")},{children:n}),"page-".concat(n))})]}))},L=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},B=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},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)},W=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=D().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],I=o({}),x=I[0],S=I[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==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)),S(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",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},x),{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",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},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,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(z,m({isSelected:!0===u,onClick:function(){return f(!0)}},{children:"True"})),e(z,m({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()}})},U=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=D(),d=u.nextIcon,f=u.prevIcon,h=o(s||new Date),v=h[0],p=h[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return n("div",m({className:"st-datepicker"},{children:[n("div",m({className:"st-datepicker-header"},{children:["days"===w&&n(t,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:f})),n("div",m({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var 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",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(a?"selected":""),onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth(),e);p(n),l(n),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},h=1;h<=o;h++)f(h);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(h=1;h<=g;h++)w(h);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({className:"st-datepicker-today-btn",onClick:function(){var e=new Date;p(e),l(e),null==c||c()}},{children:"Today"}))}))]}))},K=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,m({open:o,onClose:l,setOpen:i,width:280},{children:e(U,{value:K(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,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(z,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},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,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},_=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(_);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=_(e[t]));return n},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=_(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=m({},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=D().setHeaders,l=Z(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),m=re(p,a.accessor);if(!g||!m)return;var w=g.length,y=m.length,b=m;if(w!==y){var C=y-w;C>0&&(b=m.slice(0,-C))}var I=function(e,n,t){var r=_(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);f=I.newHeaders,v=I.emergencyBreak}if(!(c||a.accessor===h.accessor||d<10||JSON.stringify(f)===JSON.stringify(t)||v)){var x=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(x-ne<1500||d<40)||(ne=x,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:1e4,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 w(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()?m(m({},ue),e):m(m({},"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 w(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,f,h,v,p,g,m;return y(this,function(w){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,m=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(m,"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=D(),s=c.allowAnimations,u=c.isResizing,f=c.isScrolling,h=c.rowHeight,v=i(null),p=i(null),g=Z(f),w=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(!w||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=m(m({},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 x=5*h,S=b-x,R=b+C+x,E=l.y>S&&l.y<R,N=i.y>S&&i.y<R,k=i.y<b,F=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,H=.6*h,T=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&&F){var D=b+C+T(i.y,b,b+C)+A%15*H*2.5+A%7*(.4*h);return void ve({element:v.current,options:{startY:l.y,endY:D,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&k){D=b-T(i.y,b,b+C)-A%15*H*2.5-A%7*(.4*h);return void ve({element:v.current,options:{startY:l.y,endY:D,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var M=b+C+T(l.y,b,b+C)+A%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-T(l.y,b,b+C)-A%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,w,h,null==a?void 0:a.position,a]),e("div",m({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};pe.displayName="Animate";var ge=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},me=function(t){var r=t.borderClass,a=t.colIndex,s=t.header,u=t.isHighlighted,d=t.isInitialFocused,f=t.nestedIndex,h=t.rowIndex,v=t.tableRow,p=D(),g=p.cellRegistry,w=p.cellUpdateFlash,y=p.draggedHeaderRef,b=p.expandIcon,I=p.handleMouseDown,S=p.handleMouseOver,R=p.headers,E=p.hoveredHeaderRef,F=p.isCopyFlashing,A=p.isWarningFlashing,H=p.onCellEdit,T=p.onTableHeaderDragEnd,M=p.rowGrouping,L=p.rowIdAccessor,B=p.setUnexpandedRows,O=p.tableBodyContainerRef,W=p.theme,P=p.unexpandedRows,q=p.useOddColumnBackground,z=v.depth,Y=v.row,j=o(Y[s.accessor]),G=j[0],U=j[1],K=o(!1),V=K[0],J=K[1],$=o(!1),Z=$[0],_=$[1],ee=i(null),ne=k({row:Y,rowIdAccessor:L}),te=M&&M[z],re=!!te&&function(e,n){if(!n)return!1;var t=e[n];return N(t)}(Y,te),oe=!P.has(String(ne)),ie=F({rowIndex:h,colIndex:a,rowId:ne}),le=A({rowIndex:h,colIndex:a,rowId:ne}),ce=ae({draggedHeaderRef:y,headers:R,hoveredHeaderRef:E,onTableHeaderDragEnd:T}).handleDragOver,se=Q(),ue=C({accessor:s.accessor,rowId:ne}),de=x({rowId:ne,accessor:s.accessor});c(function(){if(g){var e="".concat(ne,"-").concat(s.accessor);return g.set(e,{updateContent:function(e){G!==e?(U(e),w&&(_(!0),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(function(){_(!1)},800))):U(e)}}),function(){g.delete(e),ee.current&&clearTimeout(ee.current)}}},[g,w,ne,s.accessor,G]),c(function(){if(Z){var e=setTimeout(function(){_(!1)},850);return function(){return clearTimeout(e)}}},[Z]),c(function(){U(Y[s.accessor])},[Y,s.accessor]);var fe="boolean"===s.type||"date"===s.type||"enum"===s.type,he=Boolean(null==s?void 0:s.isEditable),ve="st-cell ".concat(z>0&&s.expandable?"st-cell-depth-".concat(z):""," ").concat(u?d?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(he?"clickable":""," ").concat(Z?d?"st-cell-updating-first":"st-cell-updating":""," ").concat(ie?d?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(le?d?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(q?f%2==0?"even-column":"odd-column":""),me=l(function(e){U(e),Y[s.accessor]=e,null==H||H({accessor:s.accessor,newValue:e,row:Y,rowIndex:h})},[s.accessor,H,Y,h]),we=l(function(){B(function(e){var n=new Set(e),t=String(ne);return n.has(t)?n.delete(t):n.add(t),n})},[ne,B]);return V&&!fe?e("div",m({className:"st-cell-editing",id:C({accessor:s.accessor,rowId:ne}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(X,{enumOptions:s.enumOptions,onChange:me,setIsEditing:J,type:s.type,value:G})})):n(pe,m({className:ve,"data-accessor":s.accessor,"data-col-index":a,"data-row-id":ne,"data-row-index":h,id:ue,onDoubleClick:function(){return s.isEditable&&J(!0)},onDragOver:function(e){return se({callback:ce,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){V||"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||V||(e.preventDefault(),J(!0))},onMouseDown:function(){V||I({rowIndex:h,colIndex:a,rowId:ne})},onMouseOver:function(){V||S({rowIndex:h,colIndex:a,rowId:ne})},parentRef:O,tableRow:v},{children:[s.expandable&&re?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(oe?"expanded":"collapsed"),onClick:we},{children:b})):null,e("span",m({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"left-aligned")},{children:e("span",{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:a,row:Y,theme:W}):ge({content:G,header:s})})})),V&&fe&&e(X,{enumOptions:s.enumOptions,onChange:me,setIsEditing:J,type:s.type,value:G})]}),de)},we=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=D().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(ye,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},f)})})},ye=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=D(),h=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,m=k({row:s.row,rowIdAccessor:g});if(r.children){var w=r.children.filter(function(e){return I({header:e,pinned:a})});return e(f,{children:w.map(function(n){var r=C({accessor:n.accessor,rowId:m});return e(ye,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var y={rowIndex:l,colIndex:u,rowId:m},b=h(y),x=v(y),S=p(y),R=C({accessor:r.accessor,rowId:m});return e(me,{borderClass:b,colIndex:u,header:r,isHighlighted:x,isInitialFocused:S,nestedIndex:i,rowIndex:l,tableRow:s},R)},be=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=D(),v=h.useHoverRowBackground,p=h.rowIdAccessor,g=h.isAnimating,w=f.position,y=w%2==0,b=k({row:f.row,rowIdAccessor:p});return e("div",m({className:"st-row ".concat(y?"even":"odd"," ").concat(a===l&&v?"hovered":""),onMouseEnter:function(){g||d(l)},style:{gridTemplateColumns:o,top:P({position:w,rowHeight:s}),height:"".concat(s,"px")}},{children:e(we,{columnIndexStart:r,columnIndices:t,headers:i,pinned:c,rowIndex:w,rowIndices:u,tableRow:f},b)}))},Ce=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var 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:W({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},Ie=s(void 0),xe=["default"],Se=function(e){var n=e.childRef,t=e.children,r=function(){var e=u(Ie);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,xe),function(){n.current&&i(n.current,xe)}},[n,o,i]),h(t,{ref:function(e){n.current=e}})},Re=function(n){var r=n.condition,o=n.wrapper,i=n.children;return e(t,{children:r?o(i):e(t,{children:i})})},Ee=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,w=t.totalHeight,y=t.rowsToRender,b=t.width,C=u?"st-body-pinned-".concat(u):"st-body-main",I=D().rowIdAccessor,x=i(null);return p(r,function(){return x.current},[]),a(function(){return ee(c,u)},[c,u])?e(Re,m({condition:!u,wrapper:function(n){return e(Se,m({childRef:x},{children:n}))}},{children:e("div",m({className:C,ref:x,style:m({position:"relative",height:"".concat(w,"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(Ce,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:d,templateColumns:g,rowIndex:r-1}),e(be,{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 Ne(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}Ee.displayName="TableSection";var ke=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,w=t.tableRows,y=D(),b=y.headerContainerRef,C=y.headers,I=y.isAnimating,x=y.mainBodyRef,S=y.onLoadMore,R=y.rowHeight,E=y.rowIdAccessor,N=y.scrollbarWidth,F=y.setIsScrolling,A=y.shouldPaginate,H=y.tableBodyContainerRef,T=o(null),M=T[0],L=T[1],B=o(!1),O=B[0],W=B[1];c(function(){I&&null!==M&&L(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}(w),j=Y*(R+1)-1,G=a(function(){return Ne({headers:C,pinnedLeftColumns:s,pinnedRightColumns:f})},[C,s,f]),U=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]),K=l(function(e,n){if(S&&!A&&!O){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(W(!0),S(),setTimeout(function(){W(!1)},1e3))}},[S,A,O]),V={columnIndices:G,headerContainerRef:b,headers:C,hoveredIndex:M,rowHeight:R,rowIndices:U,rowsToRender:p,setHoveredIndex:L};return n("div",m({className:"st-body-container",onMouseLeave:function(){return L(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;F(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(function(){F(!1)},150),P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(function(){g(t),K(n,t),z.current=t})},ref:H},{children:[e(Ee,m({},V,{pinned:"left",templateColumns:u,totalHeight:j,width:d})),e(Ee,m({},V,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:j})),e(Ee,m({},V,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:h,totalHeight:j,width:v}))]}))},Fe=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,Fe(e.children)),n})},Ae=function(e){return void 0===e&&(e=0),e?e+1:0},He=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?S(o):[o],v=function(e){var n="right"===o.pinned?s-e:e-s;if(f&&h.length>1)Te({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 m=function(e){v(e.clientX)},w=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),l(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)}}},Te=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})},De=function(e){var n=e.headers,t=0,r=0,o=0;return n.forEach(function(e){if(!e.hide){var n=S(e).reduce(function(e,n){return e+function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(C({accessor:e.accessor,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:Ae(t),rightWidth:Ae(r),mainWidth:o}},Me=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},Le={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},Be=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},Oe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},We=function(e){return["between","notBetween","in","notIn"].includes(e)},Pe=function(e){return["isEmpty","isNotEmpty"].includes(e)},qe=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},ze=function(){return e("svg",m({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Ye=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],w=p[1],y=o(-1),b=y[0],C=y[1],I=i(null),x=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return n("div",m({ref:I,className:"st-custom-select ".concat(f," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[n("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:x?x.label:u})),e(ze,{})]})),e(q,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),n.value)})}))}))]}))},je=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Le[e]}});return e("div",m({className:"st-filter-section"},{children:e(Ye,{value:t,onChange:function(e){r(e)},options:o})}))},Ge=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()})},Ue=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ke=function(t){var r=t.onApply,o=t.onClear,i=t.canApply,a=t.showClear;return n("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Ve=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=Be("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=m({accessor:r.accessor,operator:u},Oe(u)&&{value:h});a(e)},w=Pe(u)||h.trim();return n(qe,{children:[e(je,{value:u,onChange:d,operators:p}),Oe(u)&&e(Ue,{children:e(Ge,{type:"text",value:h,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Ke,{onApply:g,onClear:l,canApply:!!w,showClear:!!i})]})},Je=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],m=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),w=m[0],y=m[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],I=b[1],x=Be("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 S=function(){var e={accessor:a.accessor,operator:f};Oe(f)?e.value=parseFloat(p):We(f)&&(e.values=[parseFloat(w.toString()),parseFloat(C.toString())]),s(e)};return n(qe,{children:[e(je,{value:f,onChange:h,operators:x}),Oe(f)&&e(Ue,{children:e(Ge,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:S})}),We(f)&&n(Ue,{children:[e(Ge,{type:"number",value:w,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:S}),e(Ge,{type:"number",value:C,onChange:I,placeholder:"To...",onEnterPress:S})]}),e(Ke,{onApply:S,onClear:u,canApply:!!Pe(f)||(Oe(f)?""!==p.trim():!!We(f)&&""!==String(w).trim()&&""!==String(C).trim()),showClear:!!l})]})},Xe=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(Ye,{value:t,onChange:r,options:o,className:a,placeholder:l})},$e=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=Be("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Pe(u)||""!==h;return n(qe,{children:[e(je,{value:u,onChange:d,operators:p}),Oe(u)&&e(Ue,{children:e(Xe,{value:h,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ke,{onApply:function(){var e={accessor:r.accessor,operator:u};Oe(u)&&(e.value="true"===h),a(e)},onClear:l,canApply:g,showClear:!!i})]})},Qe=function(t){var r,a,l=t.header,s=t.currentFilter,u=t.onApplyFilter,d=t.onClearFilter,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],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],I=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),x=I[0],S=I[1],R=Be("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),S(""))},[s]);var 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],w=i(null);c(function(){if(r){var e=new Date(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?new Date(r):new Date;return n("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){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,m({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(qe,{children:[e(je,{value:h,onChange:v,operators:R}),Oe(h)&&e(Ue,{children:e(E,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),We(h)&&n(Ue,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:x,onChange:S,placeholder:"To date..."})]}),e(Ke,{onApply:function(){var e={accessor:l.accessor,operator:h};Oe(h)?e.value=g:We(h)&&(e.values=[b,x]),u(e)},onClear:d,canApply:!!Pe(h)||(Oe(h)?""!==g.trim():!!We(h)&&""!==b.trim()&&""!==x.trim()),showClear:!!s})]})},Ze=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},_e=function(t){var r=t.checked,o=void 0!==r&&r,i=t.children,a=t.onChange;return n("label",m({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",m({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Ze,{className:"st-checkbox-checkmark"})})),i]}))},en=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(qe,{children:[e(Ue,{children:n("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(_e,m({checked:p,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),u.map(function(n){return e(_e,m({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",m({className:"st-enum-option-label"},{children:n.label}))}),n.value)})]}))}),e(Ke,{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})]})},nn=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(Je,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e($e,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(Qe,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Ve,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},tn=function(t){var r,i,a=t.colIndex,l=t.gridColumnEnd,s=t.gridColumnStart,u=t.gridRowEnd,d=t.gridRowStart,f=t.header,h=t.reverse,v=t.sort,p=o(!1),g=p[0],w=p[1],y=D(),I=y.columnReordering,x=y.columnResizing,S=y.draggedHeaderRef,R=y.filters,E=y.handleApplyFilter,N=y.handleClearFilter,k=y.headers,F=y.hoveredHeaderRef,A=y.onColumnOrderChange,H=y.onSort,T=y.onTableHeaderDragEnd,M=y.rowHeight,L=y.selectColumns,B=y.selectableColumns,O=y.setHeaders,W=y.setInitialFocusedCell,P=y.setIsResizing,z=y.setSelectedCells,Y=y.setSelectedColumns,j=y.sortDownIcon,G=y.sortUpIcon,U=Boolean(null==f?void 0:f.isSortable),K=Boolean(null==f?void 0:f.filterable),V=R[f.accessor],J="st-header-cell ".concat(f.accessor===(null===(r=F.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(i=S.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(U?"clickable":""," ").concat(I&&!U?"columnReordering":""," ").concat(f.children?"parent":""),X=ae({draggedHeaderRef:S,headers:k,hoveredHeaderRef:F,onColumnOrderChange:A,onTableHeaderDragEnd:T}),$=X.handleDragStart,Z=X.handleDragEnd,_=X.handleDragOver,ee=Q(),ne=function(e){var n=e.event,t=e.header;if(B){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t}(t,a);return n.shiftKey&&L?Y(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);t<i&&(i=t,o=e)});var a,l,c,s,u=b(b([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(b(b([],Array.from(e),!0),u,!0))}):L&&L(r),z(new Set),void W(null)}t.isSortable&&H(t.accessor)};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!f)return null;var te=x&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(C({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;ee({callback:He,callbackProps:{event:e.nativeEvent,gridColumnEnd:l,gridColumnStart:s,header:f,headers:k,setHeaders:O,setIsResizing:P,startWidth:t},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(C({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;ee({callback:He,callbackProps:{event:e,gridColumnEnd:l,gridColumnStart:s,header:f,headers:k,setHeaders:O,setIsResizing:P,startWidth:t},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),re=v&&v.key.accessor===f.accessor&&n("div",m({className:"st-icon-container",onClick:function(e){return ne({event:e,header:f})}},{children:["ascending"===v.direction&&G&&G,"descending"===v.direction&&j&&j]})),oe=K&&n("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),w(!g)}},{children:[e(Me,{className:"st-header-icon",style:{fill:V?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(q,m({open:g,overflow:"visible",setOpen:w,onClose:function(){return w(!1)}},{children:e(nn,{header:f,currentFilter:V,onApplyFilter:function(e){E(e),w(!1)},onClearFilter:function(){N(f.accessor),w(!1)}})}))]}));return n(pe,m({className:J,id:C({accessor:f.accessor,rowId:"header"}),onDragOver:function(e){ee({callback:_,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:m(m({gridRowStart:d,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-d>1?{}:{height:M})},{children:[h&&te,"right"===f.align&&oe,"right"===f.align&&re,e("div",m({className:"st-header-label",draggable:I&&!f.disableReorder,onClick:function(e){return ne({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),Z()},onDragStart:function(e){I&&f&&function(e){$(e)}(f)}},{children:e("span",m({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:a,header:f}):null==f?void 0:f.label}))})),"right"!==f.align&&re,"right"!==f.align&&oe,!h&&te]}))},rn=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(Re,m({condition:!s,wrapper:function(n){return e(Se,m({childRef:u},{children:n}))}},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,display:"grid",position:"relative",width:f}},{children:e(t,{children:h.map(function(n){return e(tn,{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)})})}))}))},on=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(on)):1},an=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=D(),p=v.headerContainerRef,g=v.pinnedLeftRef,w=v.pinnedRightRef,y=a(function(){return Ne({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=on(n);e=Math.max(e,t)}}),{maxDepth:e}},[o]).maxDepth;return n("div",m({className:"st-header-container",ref:p},{children:[ee(o,"left")&&e(rn,{columnIndices:y,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:b,pinned:"left",sectionRef:g,sort:d,width:f}),e(rn,{columnIndices:y,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:b,sectionRef:r,sort:d}),ee(o,"right")&&e(rn,{columnIndices:y,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:b,pinned:"right",sectionRef:w,sort:d,width:h})]}))},ln=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(" "))},cn=function(t){var r=t.pinnedLeftWidth,o=t.pinnedRightWidth,l=t.setScrollTop,c=t.sort,s=t.tableRows,u=t.rowsToRender,d=D(),f=d.columnResizing,h=d.editColumns,v=d.headers,p=i(null),g=v.filter(function(e){return!e.pinned}),w=v.filter(function(e){return"left"===e.pinned}),y=v.filter(function(e){return"right"===e.pinned}),b=a(function(){return ln({headers:w})},[w]),C=a(function(){return ln({headers:g})},[g]),I=a(function(){return ln({headers:y})},[y]),x={centerHeaderRef:p,headers:v,mainTemplateColumns:C,pinnedLeftColumns:w,pinnedLeftTemplateColumns:b,pinnedRightColumns:y,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},S={tableRows:s,mainTemplateColumns:C,pinnedLeftColumns:w,pinnedLeftTemplateColumns:b,pinnedLeftWidth:r,pinnedRightColumns:y,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return n("div",m({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:h?"calc(100% - 27.5px)":"100%"}},{children:[e(an,m({},x)),e(ke,m({},S))]}))},sn=function(t){var r,a,l=t.mainBodyWidth,s=t.mainBodyRef,u=t.pinnedLeftWidth,d=t.pinnedRightWidth,f=t.tableBodyContainerRef,h=D().editColumns,v=o(!1),p=v[0],g=v[1],w=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",m({className:"st-horizontal-scrollbar-container"},{children:[u>0&&e("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(r=w.current)||void 0===r?void 0:r.offsetHeight}}),l>0&&e(Se,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w,style:{flexGrow:1}},{children:e("div",{style:{width:l,height:".3px"}})}))})),d>0&&e("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:C,height:null===(a=w.current)||void 0===a?void 0:a.offsetHeight}}),b>0&&e("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},un={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 un.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?un.string(e,n,t):"number"==typeof e&&"number"==typeof n?un.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?un.boolean(e,n,t):un.string(String(e),String(n),t)}},dn=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 un.number(i,a,r)}return"date"===t?un.date(String(e),String(n),r):"boolean"===t?un.boolean(Boolean(e),Boolean(n),r):"enum"===t?un.enum(String(e),String(n),r):un.string(String(e),String(n),r)}(e[r],n[r],a,l)})},fn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return dn({rows:t,sortColumn:r,headers:n})},hn=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}):fn({headers:i,rows:t,sortColumn:r}):t},vn=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(vn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},pn=function(e){return e.every(function(e){return e.hide})},gn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(gn(e.children),pn(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=D(),p=v.expandIcon,g=v.headers,w=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&&pn(s.children);return n(t,{children:[n("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:C?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(f?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),h(!f)}},{children:p})):null})),e(_e,m({checked:I,onChange:function(e){(s.hide=e,e)?gn(i):(vn(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,vn(i,s.children[0].accessor)));w(b([],g,!0))}},{children:s.label}))]})),C&&f&&s.children&&e("div",m({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))})}))]})},wn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return e(mn,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},yn=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",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){f(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(wn,{headers:l,open:d,position:s})]})):null},bn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Cn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},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(Ie.Provider,m({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=Le[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},Sn=function(){var t=D(),r=t.filters,o=t.handleClearFilter,i=t.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(t){return n("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:xn(t,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(t.accessor)},"aria-label":"Remove filter for ".concat(t.accessor)},{children:"×"}))]}),t.accessor)})}))}))}))},Rn=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},En=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=Rn(h),g=Rn(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 Rn(new Date(String(e||"")))}),w=m[0],y=m[1];return p>=w&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return Rn(new Date(String(e||"")))});return w=b[0],y=b[1],p<w||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(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 x=String(e),S=o.includes(x);return"in"===t?S:!S}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},Nn=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 Fe(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=m({},n);return s[o]=c,e.forEach(function(e){var n=kn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},kn=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(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(An,m({},n)):null},An=function(t){var r=t.allowAnimations,s=void 0!==r&&r,u=t.cellUpdateFlash,f=void 0!==u&&u,h=t.columnEditorPosition,v=void 0===h?"right":h,p=t.columnEditorText,C=void 0===p?"Columns":p,I=t.columnReordering,R=void 0!==I&&I,E=t.columnResizing,H=void 0!==E&&E,D=t.defaultHeaders,W=t.editColumns,P=void 0!==W&&W,q=t.editColumnsInitOpen,z=void 0!==q&&q,Y=t.expandAll,j=void 0===Y||Y,G=t.expandIcon,U=void 0===G?e(B,{className:"st-expand-icon"}):G,K=t.externalFilterHandling,V=void 0!==K&&K,J=t.externalSortHandling,X=void 0!==J&&J,$=t.height,Q=t.hideFooter,_=void 0!==Q&&Q,ee=t.nextIcon,ne=void 0===ee?e(B,{className:"st-next-prev-icon"}):ee,te=t.onCellEdit,re=t.onColumnOrderChange,oe=t.onFilterChange,ie=t.onGridReady,ae=t.onLoadMore,le=t.onNextPage,ce=t.onSortChange,ue=t.prevIcon,de=void 0===ue?e(L,{className:"st-next-prev-icon"}):ue,fe=t.rowGrouping,he=t.rowHeight,ve=void 0===he?32:he,pe=t.rowIdAccessor,ge=t.rows,me=t.rowsPerPage,we=void 0===me?10:me,ye=t.selectableCells,be=void 0!==ye&&ye,Ce=t.selectableColumns,Ie=void 0!==Ce&&Ce,xe=t.shouldPaginate,Se=void 0!==xe&&xe,Re=t.sortDownIcon,Ee=void 0===Re?e(bn,{className:"st-header-icon"}):Re,Ne=t.sortUpIcon,ke=void 0===Ne?e(Cn,{className:"st-header-icon"}):Ne,Fe=t.tableRef,Ae=t.theme,He=void 0===Ae?"light":Ae,Te=t.useHoverRowBackground,Me=void 0===Te||Te,Le=t.useOddEvenRowBackground,Be=void 0===Le||Le,Oe=t.useOddColumnBackground,We=void 0!==Oe&&Oe;We&&(Be=!1);var Pe=g(function(e){return e+1},0)[1],qe=i(null),ze=i(null),Ye=i(null),je=i(null),Ge=i(null),Ue=i(null),Ke=i(null),Ve=o(1),Je=Ve[0],Xe=Ve[1],$e=o(D),Qe=$e[0],Ze=$e[1],_e=o(!1),en=_e[0],nn=_e[1],tn=o(!1),rn=tn[0],on=tn[1];c(function(){Ze(D)},[D]);var an=o(0),ln=an[0],un=an[1],dn=o(new Set),vn=dn[0],pn=dn[1],gn=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:Ue}),mn=gn.scrollbarWidth,wn=gn.setScrollbarWidth,xn=a(function(){var e=De({headers:Qe});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth}},[Qe]),Rn=xn.mainBodyWidth,kn=xn.pinnedLeftWidth,Fn=xn.pinnedRightWidth,An=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:$,rowHeight:ve}),Hn=Nn({rows:ge,headers:Qe,rowGrouping:fe}),Tn=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return En({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=m(m({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),f=l(function(e){var n=m({},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=m(m({},c),((r={})[e.accessor]=e,r));return En({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:f,clearAllFilters:h,filters:c,computeFilteredRowsPreview:v}}({rows:Hn,externalFilterHandling:V,onFilterChange:oe}),Dn=Tn.filters,Mn=Tn.filteredRows,Ln=Tn.updateFilter,Bn=Tn.clearFilter,On=Tn.clearAllFilters,Wn=Tn.computeFilteredRowsPreview,Pn=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=fn({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 m(m({},e),((r={})[i]=l,r))}return e}):i},[]),h=a(function(){return hn({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"},hn({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:Qe,tableRows:Mn,externalSortHandling:X,onSortChange:ce,rowGrouping:fe}),qn=Pn.sort,zn=Pn.sortedRows,Yn=Pn.updateSort,jn=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,w=e.rowHeight,y=e.scrollTop,C=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,x=o(!1),S=x[0],R=x[1],E=o([]),N=E[0],A=E[1],H=i([]),T=i([]),D=i(new Map),M=i(null),L=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===D.current.size){var e=L(r),n=new Map;e.forEach(function(e){var t=String(k({row:e.row,rowIdAccessor:h}));n.set(t,e.position)}),D.current=n}},[r,L,h]);var B=a(function(){return L(t)},[t,L]),W=a(function(){return O({bufferRowCount:5,contentHeight:g,tableRows:B,rowHeight:w,scrollTop:y})},[B,g,w,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=B.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]})},[B,h]);d(function(){if(!S){if(!n||u)return A([]),H.current=B,void(T.current=W);if(0===H.current.length)return A([]),H.current=B,void(T.current=W);if(!q)return A([]),H.current=B,void(T.current=W);M.current={tableRows:B,visibleRows:W},R(!0)}},[n,B,q,S,u,W]),d(function(){if(S&&M.current&&N.length>0){var e=setTimeout(function(){var e=M.current;R(!1),A([]),H.current=e.tableRows,T.current=e.visibleRows,M.current=null},se.duration+100);return function(){return clearTimeout(e)}}},[S,N.length]);var z=a(function(){if(!n||u)return W;if(N.length>0){var e=new Map;return B.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?m(m({},n),{position:r}):n})}return W},[W,N,B,n,u,h]),Y=l(function(e){if(n&&!u){var t=C(e),r=L(t),o=O({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=P(W,o).entering.map(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(k({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&A(b(b([],W,!0),i,!0))}},[n,u,C,L,g,w,y,P,B,W,h]),j=l(function(e){if(n&&!u){var t=I(e),r=L(t),o=O({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=P(W,o).entering.map(function(e){var n=String(k({row:e.row,rowIdAccessor:h}));return B.find(function(e){return String(k({row:e.row,rowIdAccessor:h}))===n})||e}).filter(Boolean);i.length>0&&A(b(b([],W,!0),i,!0))}},[n,u,I,L,g,w,y,P,B,W,h]);return{currentTableRows:B,currentVisibleRows:W,isAnimating:S,prepareForFilterChange:Y,prepareForSortChange:j,rowsToRender:z}}({allowAnimations:s,sortedRows:zn,originalRows:Hn,currentPage:Je,rowsPerPage:we,shouldPaginate:Se,rowGrouping:fe,rowIdAccessor:pe,unexpandedRows:vn,expandAll:j,contentHeight:An,rowHeight:ve,scrollTop:ln,computeFilteredRowsPreview:Wn,computeSortedRowsPreview:Pn.computeSortedRowsPreview}),Gn=jn.currentTableRows,Un=jn.rowsToRender,Kn=jn.prepareForFilterChange,Vn=jn.prepareForSortChange,Jn=jn.isAnimating,Xn=i(new Map),$n=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],m=p[1],b=o(null),C=b[0],I=b[1],x=o(null),R=x[0],E=x[1],N=o(new Set),F=N[0],H=N[1],T=o(new Set),D=T[0],M=T[1],L=i(!1),B=i(null),O=a(function(){return t.flatMap(S)},[t]),W=l(function(){var e=O.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))},[O,h,r]),P=l(function(){return w(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=O.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 m=e;if("number"===p.type){var w=Number(e);isNaN(w)||(m=w)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(m=y)}if(v.row[p.accessor]=m,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(m)}null==u||u({accessor:p.accessor,newValue:m,row:v.row,rowIndex:f});var I=A({colIndex:h,rowIndex:f,rowId:g});o.add(I)}else{var x=A({colIndex:h,rowIndex:f,rowId:g});i.add(x)}}})}),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,O,r,s,u,d]),q=l(function(){if(0!==h.size){var e=O.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,O,r,s,u,d]),z=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=k({row:r[c].row,rowIdAccessor:s});t.add(A({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),I(null),v(t)},[r,s,m,I,v]),Y=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<O.length){var n=A(e);m(new Set),I(null),v(new Set([n])),E(e)}},[O.length,r.length,m,I,v,E]),j=l(function(e,n){void 0===n&&(n=!1),v(new Set),E(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[v,E,m,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void P();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void q();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});Y({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}),Y({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}),Y({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<O.length-1&&(c=k({row:r[o].row,rowIdAccessor:s}),Y({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(v(new Set),m(new Set),I(null),B.current=null,E(null))}else W()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[W,O.length,R,s,z,Y,n,r,P,q]);var G=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=A({colIndex:n,rowIndex:t,rowId:r}),i=h.has(o),a=g.has(n);return i||a},[h,g]),U=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||!G(c)||g.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!G(u)||g.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),G(d)||i.push("st-selected-left-border"),G(f)||i.push("st-selected-right-border"),i.join(" ")},[G,r,g,s]),K=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]),V=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=A({colIndex:n,rowIndex:t,rowId:r});return F.has(o)},[F]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=A({colIndex:n,rowIndex:t,rowId:r});return D.has(o)},[D]);return{getBorderClass:U,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(L.current=!0,B.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){m(new Set),I(null);var e=A({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&&L.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=k({row:r[d].row,rowIdAccessor:s});i.add(A({colIndex:f,rowIndex:d,rowId:h}))}v(i)}},handleMouseUp:function(){L.current=!1},isCopyFlashing:V,isWarningFlashing:J,isInitialFocusedCell:K,isSelected:G,lastSelectedColumnIndex:C,pasteFromClipboard:P,selectColumns:j,selectedCells:h,selectedColumns:g,setInitialFocusedCell:E,setSelectedCells:v,setSelectedColumns:m,deleteSelectedCells:q}}({selectableCells:be,headers:Qe,tableRows:Gn,rowIdAccessor:pe,onCellEdit:te,cellRegistry:Xn.current}),Qn=$n.getBorderClass,Zn=$n.handleMouseDown,_n=$n.handleMouseOver,et=$n.handleMouseUp,nt=$n.isCopyFlashing,tt=$n.isInitialFocusedCell,rt=$n.isSelected,ot=$n.isWarningFlashing,it=$n.selectColumns,at=$n.selectedCells,lt=$n.selectedColumns,ct=$n.setInitialFocusedCell,st=$n.setSelectedCells,ut=$n.setSelectedColumns,dt=l(function(e){Vn(e),setTimeout(function(){Yn(e)},0)},[Vn,Yn]),ft=l(function(e){Ze(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns;c(function(){var e=function(e){var a=e.target;a.closest(".st-cell")||n&&(a.classList.contains("st-header-cell")||a.classList.contains("st-header-label"))||(t.size>0&&o(new Set),r.size>0&&i(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i])}({selectableColumns:Ie,selectedCells:at,selectedColumns:lt,setSelectedCells:st,setSelectedColumns:ut}),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:Pe,tableBodyContainerRef:Ue,setScrollbarWidth:wn}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:ie}),function(e){var n=e.tableRef,t=e.rows,r=e.rowIdAccessor,o=e.cellRegistryRef;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=x({rowId:c,accessor:n}),u=o.current.get(s);u&&u.updateContent(a),void 0!==l[n]&&(l[n]=a)}}})},[o,t,r,n])}({cellRegistryRef:Xn,rowIdAccessor:pe,rows:ge,tableRef:Fe}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Dn,onFilterChange:oe}),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:qn,onSortChange:ce});var ht=l(function(e){Kn(e),setTimeout(function(){Ln(e)},0)},[Kn,Ln]);return e(T,m({value:{allowAnimations:s,cellRegistry:Xn.current,cellUpdateFlash:f,columnReordering:R,columnResizing:H,draggedHeaderRef:qe,editColumns:P,expandIcon:U,filters:Dn,forceUpdate:Pe,getBorderClass:Qn,handleApplyFilter:ht,handleClearAllFilters:On,handleClearFilter:Bn,handleMouseDown:Zn,handleMouseOver:_n,headerContainerRef:Ke,headers:Qe,hoveredHeaderRef:ze,isAnimating:Jn,isCopyFlashing:nt,isInitialFocusedCell:tt,isResizing:en,isScrolling:rn,isSelected:rt,isWarningFlashing:ot,mainBodyRef:Ye,nextIcon:ne,onCellEdit:te,onColumnOrderChange:re,onLoadMore:ae,onSort:dt,onTableHeaderDragEnd:ft,pinnedLeftRef:je,pinnedRightRef:Ge,prevIcon:de,rowGrouping:fe,rowHeight:ve,rowIdAccessor:pe,scrollbarWidth:mn,selectColumns:it,selectableColumns:Ie,setHeaders:Ze,setInitialFocusedCell:ct,setIsResizing:nn,setIsScrolling:on,setSelectedCells:st,setSelectedColumns:ut,setUnexpandedRows:pn,shouldPaginate:Se,sortDownIcon:Ee,sortUpIcon:ke,tableBodyContainerRef:Ue,tableRows:Gn,theme:He,unexpandedRows:vn,useHoverRowBackground:Me,useOddColumnBackground:We,useOddEvenRowBackground:Be}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(He),style:$?{height:$}:{}},{children:e(In,{children:n("div",m({className:"st-wrapper-container"},{children:[e(Sn,{}),n("div",m({className:"st-content-wrapper",onMouseUp:et,onMouseLeave:et},{children:[e(cn,{pinnedLeftWidth:kn,pinnedRightWidth:Fn,setScrollTop:un,sort:qn,tableRows:Gn,rowsToRender:Un}),e(yn,{columnEditorText:C,editColumns:P,editColumnsInitOpen:z,headers:Qe,position:v})]})),e(sn,{mainBodyRef:Ye,mainBodyWidth:Rn,pinnedLeftWidth:kn,pinnedRightWidth:Fn,tableBodyContainerRef:Ue}),e(M,{currentPage:Je,hideFooter:_,onPageChange:Xe,onNextPage:le,shouldPaginate:Se,totalPages:Math.ceil(zn.length/we)})]}))})}))}))};export{Fn as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map