clash_for_linux/dashboard/public/assets/Connections.e48eac36.js

2 lines
70 KiB
JavaScript

import{r as se,R as be,c as Ae,a as ro,M as Cn,j as q,b as ye,p as pn,m as gn,d as oo,B as vn,e as io,f as ao,g as uo,u as so,C as lo,F as co,I as fo,h as po,S as go}from"./index.171f553a.js";import{u as vo}from"./useRemainingViewPortHeight.7395542b.js";import{C as mo}from"./chevron-down.dd238e96.js";import{f as ho}from"./index.92e2d967.js";import{F as yo,p as wo,A as bo}from"./Fab.ef67ff10.js";import{P as Ro,a as Co}from"./play.7b1a5f99.js";function yt(b){return function(v){return!!v.type&&v.type.tabsRole===b}}var tt=yt("Tab"),wt=yt("TabList"),bt=yt("TabPanel");function So(b){return tt(b)||wt(b)||bt(b)}function vt(b,v){return se.exports.Children.map(b,function(f){return f===null?null:So(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"?se.exports.cloneElement(f,Object.assign({},f.props,{children:vt(f.props.children,v)})):f})}function Sn(b,v){return se.exports.Children.forEach(b,function(f){f!==null&&(tt(f)||bt(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"&&(wt(f)&&v(f),Sn(f.props.children,v)))})}function Pn(b){var v=0;return Sn(b,function(f){tt(f)&&v++}),v}var Po=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function xo(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_<g.length;_++)O=g[_],!(v.indexOf(O)>=0)&&(f[O]=b[O]);return f}function xn(b){return b&&"getAttribute"in b}function mn(b){return xn(b)&&b.getAttribute("data-rttab")}function ke(b){return xn(b)&&b.getAttribute("aria-disabled")==="true"}var et;function Bo(b){var v=b||(typeof window<"u"?window:void 0);try{et=!!(typeof v<"u"&&v.document&&v.document.activeElement)}catch{et=!1}}var Eo={className:"react-tabs",focus:!1},Rt=function(v){var f=se.exports.useRef([]),g=se.exports.useRef([]),O=se.exports.useRef();function _(m,G){if(!(m<0||m>=X())){var M=v.onSelect,K=v.selectedIndex;M(m,K,G)}}function c(m){for(var G=X(),M=m+1;M<G;M++)if(!ke(ee(M)))return M;for(var K=0;K<m;K++)if(!ke(ee(K)))return K;return m}function U(m){for(var G=m;G--;)if(!ke(ee(G)))return G;for(G=X();G-- >m;)if(!ke(ee(G)))return G;return m}function de(){for(var m=X(),G=0;G<m;G++)if(!ke(ee(G)))return G;return null}function u(){for(var m=X();m--;)if(!ke(ee(m)))return m;return null}function X(){var m=v.children;return Pn(m)}function ee(m){return f.current["tabs-"+m]}function le(){var m=0,G=v.children,M=v.disabledTabClassName,K=v.focus,ae=v.forceRenderTabPanel,ve=v.selectedIndex,Be=v.selectedTabClassName,me=v.selectedTabPanelClassName,Ce=v.environment;g.current=g.current||[];for(var we=g.current.length-X(),He=se.exports.useId();we++<0;)g.current.push(""+He+g.current.length);return vt(G,function(ne){var Ge=ne;if(wt(ne)){var Ee=0,Ne=!1;et==null&&Bo(Ce);var Se=Ce||(typeof window<"u"?window:void 0);et&&Se&&(Ne=be.Children.toArray(ne.props.children).filter(tt).some(function(Te,Fe){return Se.document.activeElement===ee(Fe)})),Ge=se.exports.cloneElement(ne,{children:vt(ne.props.children,function(Te){var Fe="tabs-"+Ee,$e=ve===Ee,Oe={tabRef:function(ot){f.current[Fe]=ot},id:g.current[Ee],selected:$e,focus:$e&&(K||Ne)};return Be&&(Oe.selectedClassName=Be),M&&(Oe.disabledClassName=M),Ee++,se.exports.cloneElement(Te,Oe)})})}else if(bt(ne)){var Ie={id:g.current[m],selected:ve===m};ae&&(Ie.forceRender=ae),me&&(Ie.selectedClassName=me),m++,Ge=se.exports.cloneElement(ne,Ie)}return Ge})}function fe(m){var G=v.direction,M=v.disableUpDownKeys;if(J(m.target)){var K=v.selectedIndex,ae=!1,ve=!1;(m.code==="Space"||m.keyCode===32||m.code==="Enter"||m.keyCode===13)&&(ae=!0,ve=!1,D(m)),m.code==="ArrowLeft"||m.keyCode===37||!M&&(m.keyCode===38||m.code==="ArrowUp")?(G==="rtl"?K=c(K):K=U(K),ae=!0,ve=!0):m.code==="ArrowRight"||m.keyCode===39||!M&&(m.keyCode===40||m.code==="ArrowDown")?(G==="rtl"?K=U(K):K=c(K),ae=!0,ve=!0):m.keyCode===35||m.code==="End"?(K=u(),ae=!0,ve=!0):(m.keyCode===36||m.code==="Home")&&(K=de(),ae=!0,ve=!0),ae&&m.preventDefault(),ve&&_(K,m)}}function D(m){var G=m.target;do if(J(G)){if(ke(G))return;var M=[].slice.call(G.parentNode.children).filter(mn).indexOf(G);_(M,m);return}while((G=G.parentNode)!=null)}function J(m){if(!mn(m))return!1;var G=m.parentElement;do{if(G===O.current)return!0;if(G.getAttribute("data-rttabs"))break;G=G.parentElement}while(G);return!1}v.children;var ce=v.className;v.disabledTabClassName;var Z=v.domRef;v.focus,v.forceRenderTabPanel,v.onSelect,v.selectedIndex,v.selectedTabClassName,v.selectedTabPanelClassName,v.environment,v.disableUpDownKeys;var ie=xo(v,Po);return be.createElement("div",Object.assign({},ie,{className:Ae(ce),onClick:D,onKeyDown:fe,ref:function(G){O.current=G,Z&&Z(G)},"data-rttabs":!0}),le())};Rt.defaultProps=Eo;Rt.propTypes={};var Io=0,Ze=1,To={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1},Fo=function(v){return v.selectedIndex===null?Ze:Io},nt=function(v){var f=v.children,g=v.defaultFocus,O=v.defaultIndex,_=v.focusTabOnClick,c=v.onSelect,U=se.exports.useState(g),de=U[0],u=U[1],X=se.exports.useState(Fo(v)),ee=X[0],le=se.exports.useState(ee===Ze?O||0:null),fe=le[0],D=le[1];if(se.exports.useEffect(function(){u(!1)},[]),ee===Ze){var J=Pn(f);se.exports.useEffect(function(){if(fe!=null){var ie=Math.max(0,J-1);D(Math.min(fe,ie))}},[J])}var ce=function(m,G,M){typeof c=="function"&&c(m,G,M)===!1||(_&&u(!0),ee===Ze&&D(m))},Z=Object.assign({},v);return Z.focus=de,Z.onSelect=ce,fe!=null&&(Z.selectedIndex=fe),delete Z.defaultFocus,delete Z.defaultIndex,delete Z.focusTabOnClick,be.createElement(Rt,Z,f)};nt.propTypes={};nt.defaultProps=To;nt.tabsRole="Tabs";var ko=["children","className"];function Ao(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_<g.length;_++)O=g[_],!(v.indexOf(O)>=0)&&(f[O]=b[O]);return f}var Go={className:"react-tabs__tab-list"},rt=function(v){var f=v.children,g=v.className,O=Ao(v,ko);return be.createElement("ul",Object.assign({},O,{className:Ae(g),role:"tablist"}),f)};rt.tabsRole="TabList";rt.propTypes={};rt.defaultProps=Go;var Ho=["children","className","disabled","disabledClassName","focus","id","selected","selectedClassName","tabIndex","tabRef"];function No(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_<g.length;_++)O=g[_],!(v.indexOf(O)>=0)&&(f[O]=b[O]);return f}var gt="react-tabs__tab",Oo={className:gt,disabledClassName:gt+"--disabled",focus:!1,id:null,selected:!1,selectedClassName:gt+"--selected"},De=function(v){var f,g=se.exports.useRef(),O=v.children,_=v.className,c=v.disabled,U=v.disabledClassName,de=v.focus,u=v.id,X=v.selected,ee=v.selectedClassName,le=v.tabIndex,fe=v.tabRef,D=No(v,Ho);return se.exports.useEffect(function(){X&&de&&g.current.focus()},[X,de]),be.createElement("li",Object.assign({},D,{className:Ae(_,(f={},f[ee]=X,f[U]=c,f)),ref:function(ce){g.current=ce,fe&&fe(ce)},role:"tab",id:"tab"+u,"aria-selected":X?"true":"false","aria-disabled":c?"true":"false","aria-controls":"panel"+u,tabIndex:le||(X?"0":null),"data-rttab":!0}),O)};De.propTypes={};De.tabsRole="Tab";De.defaultProps=Oo;var Wo=["children","className","forceRender","id","selected","selectedClassName"];function _o(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_<g.length;_++)O=g[_],!(v.indexOf(O)>=0)&&(f[O]=b[O]);return f}var hn="react-tabs__tab-panel",zo={className:hn,forceRender:!1,selectedClassName:hn+"--selected"},Ve=function(v){var f,g=v.children,O=v.className,_=v.forceRender,c=v.id,U=v.selected,de=v.selectedClassName,u=_o(v,Wo);return be.createElement("div",Object.assign({},u,{className:Ae(O,(f={},f[de]=U,f)),role:"tabpanel",id:"panel"+c,"aria-labelledby":"tab"+c}),_||U?g:null)};Ve.tabsRole="TabPanel";Ve.propTypes={};Ve.defaultProps=zo;const Mo="_placeHolder_12xws_1",jo="_connQty_12xws_10",Lo="_inputWrapper_12xws_22",Do="_input_12xws_22",Le={placeHolder:Mo,connQty:jo,inputWrapper:Lo,input:Do};var mt={exports:{}},ht={exports:{}};(function(b,v){(function(f,g){g(v,se.exports)})(ro,function(f,g){function O(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(d){return void n(d)}s.done?t(l):Promise.resolve(l).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){O(o,r,i,a,s,"next",l)}function s(l){O(o,r,i,a,s,"throw",l)}a(void 0)})}}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function U(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function de(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}g=g&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g;var u={init:"init"},X=function(e){var t=e.value;return t===void 0?"":t},ee=function(){return g.createElement(g.Fragment,null,"\xA0")},le={Cell:X,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(r,i){var o=i.style,a=i.className;return r=c({},r,{},U(i,["style","className"])),o&&(r.style=r.style?c({},r.style||{},{},o||{}):o),a&&(r.className=r.className?r.className+" "+a:a),r.className===""&&delete r.className,r},{})}var D=function(e,t){return t===void 0&&(t={}),function(n){return n===void 0&&(n={}),[].concat(e,[n]).reduce(function(r,i){return function o(a,s,l){return typeof s=="function"?o({},s(a,l)):Array.isArray(s)?fe.apply(void 0,[a].concat(s)):fe(a,s)}(r,i,c({},t,{userProps:n}))},{})}},J=function(e,t,n,r){return n===void 0&&(n={}),e.reduce(function(i,o){return o(i,n)},t)},ce=function(e,t,n){return n===void 0&&(n={}),e.forEach(function(r){r(t,n)})};function Z(e,t,n,r){e.findIndex(function(i){return i.pluginName===n}),t.forEach(function(i){e.findIndex(function(o){return o.pluginName===i})})}function ie(e,t){return typeof e=="function"?e(t):e}function m(e){var t=g.useRef();return t.current=e,g.useCallback(function(){return t.current},[])}var G=typeof document<"u"?g.useLayoutEffect:g.useEffect;function M(e,t){var n=g.useRef(!1);G(function(){n.current&&e(),n.current=!0},t)}function K(e,t,n){return n===void 0&&(n={}),function(r,i){i===void 0&&(i={});var o=typeof r=="string"?t[r]:r;if(o===void 0)throw console.info(t),new Error("Renderer Error \u261D\uFE0F");return ae(o,c({},e,{column:t},n,{},i))}}function ae(e,t){return function(r){return typeof r=="function"&&(i=Object.getPrototypeOf(r)).prototype&&i.prototype.isReactComponent;var i}(n=e)||typeof n=="function"||function(r){return typeof r=="object"&&typeof r.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(r.$$typeof.description)}(n)?g.createElement(e,t):e;var n}function ve(e,t,n){return n===void 0&&(n=0),e.map(function(r){return me(r=c({},r,{parent:t,depth:n})),r.columns&&(r.columns=ve(r.columns,r,n+1)),r})}function Be(e){return Ee(e,"columns")}function me(e){var t=e.id,n=e.accessor,r=e.Header;if(typeof n=="string"){t=t||n;var i=n.split(".");n=function(o){return function(a,s,l){if(!s)return a;var d,R=typeof s=="function"?s:JSON.stringify(s),h=He.get(R)||function(){var y=function(p){return function w(S,P){if(P===void 0&&(P=[]),Array.isArray(S))for(var E=0;E<S.length;E+=1)w(S[E],P);else P.push(S);return P}(p).map(function(w){return String(w).replace(".","_")}).join(".").replace($e,".").replace(Oe,"").split(".")}(s);return He.set(R,y),y}();try{d=h.reduce(function(y,p){return y[p]},a)}catch{}return d!==void 0?d:l}(o,i)}}if(!t&&typeof r=="string"&&r&&(t=r),!t&&e.columns)throw console.error(e),new Error('A column ID (or unique "Header" value) is required!');if(!t)throw console.error(e),new Error("A column ID (or string accessor) is required!");return Object.assign(e,{id:t,accessor:n}),e}function Ce(e,t){if(!t)throw new Error;return Object.assign(e,c({Header:ee,Footer:ee},le,{},t,{},e)),Object.assign(e,{originalWidth:e.width}),e}function we(e,t,n){n===void 0&&(n=function(){return{}});for(var r=[],i=e,o=0,a=function(){return o++},s=function(){var l={headers:[]},d=[],R=i.some(function(h){return h.parent});i.forEach(function(h){var y,p=[].concat(d).reverse()[0];R&&(h.parent?y=c({},h.parent,{originalId:h.parent.id,id:h.parent.id+"_"+a(),headers:[h]},n(h)):y=Ce(c({originalId:h.id+"_placeholder",id:h.id+"_placeholder_"+a(),placeholderOf:h,headers:[h]},n(h)),t),p&&p.originalId===y.originalId?p.headers.push(h):d.push(y)),l.headers.push(h)}),r.push(l),i=d};i.length;)s();return r.reverse()}var He=new Map;function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r+=1)if(t[r]!==void 0)return t[r]}function Ge(e){if(typeof e=="function")return e}function Ee(e,t){var n=[];return function r(i){i.forEach(function(o){o[t]?r(o[t]):n.push(o)})}(e),n}function Ne(e,t){var n=t.manualExpandedKey,r=t.expanded,i=t.expandSubRows,o=i===void 0||i,a=[];return e.forEach(function(s){return function l(d,R){R===void 0&&(R=!0),d.isExpanded=d.original&&d.original[n]||r[d.id],d.canExpand=d.subRows&&!!d.subRows.length,R&&a.push(d),d.subRows&&d.subRows.length&&d.isExpanded&&d.subRows.forEach(function(h){return l(h,o)})}(s)}),a}function Se(e,t,n){return Ge(e)||t[e]||n[e]||n.text}function Ie(e,t,n){return e?e(t,n):t===void 0}function Te(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var Fe=null,$e=/\[/g,Oe=/\]/g,Ct=function(e){return c({role:"table"},e)},ot=function(e){return c({role:"rowgroup"},e)},En=function(e,t){var n=t.column;return c({key:"header_"+n.id,colSpan:n.totalVisibleHeaderCount,role:"columnheader"},e)},In=function(e,t){var n=t.column;return c({key:"footer_"+n.id,colSpan:n.totalVisibleHeaderCount},e)},Tn=function(e,t){return c({key:"headerGroup_"+t.index,role:"row"},e)},Fn=function(e,t){return c({key:"footerGroup_"+t.index},e)},kn=function(e,t){return c({key:"row_"+t.row.id,role:"row"},e)},An=function(e,t){var n=t.cell;return c({key:"cell_"+n.row.id+"_"+n.column.id,role:"cell"},e)};function Gn(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[Ct],getTableBodyProps:[ot],getHeaderGroupProps:[Tn],getFooterGroupProps:[Fn],getHeaderProps:[En],getFooterProps:[In],getRowProps:[kn],getCellProps:[An],useFinalInstance:[]}}u.resetHiddenColumns="resetHiddenColumns",u.toggleHideColumn="toggleHideColumn",u.setHiddenColumns="setHiddenColumns",u.toggleHideAllColumns="toggleHideAllColumns";var St=function(e){e.getToggleHiddenProps=[Hn],e.getToggleHideAllColumnsProps=[Nn],e.stateReducers.push(On),e.useInstanceBeforeDimensions.push(Wn),e.headerGroupsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.hiddenColumns])}),e.useInstance.push(_n)};St.pluginName="useColumnVisibility";var Hn=function(e,t){var n=t.column;return[e,{onChange:function(r){n.toggleHidden(!r.target.checked)},style:{cursor:"pointer"},checked:n.isVisible,title:"Toggle Column Visible"}]},Nn=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleHideAllColumns(!r.target.checked)},style:{cursor:"pointer"},checked:!n.allColumnsHidden&&!n.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!n.allColumnsHidden&&n.state.hiddenColumns.length}]};function On(e,t,n,r){if(t.type===u.init)return c({hiddenColumns:[]},e);if(t.type===u.resetHiddenColumns)return c({},e,{hiddenColumns:r.initialState.hiddenColumns||[]});if(t.type===u.toggleHideColumn){var i=(t.value!==void 0?t.value:!e.hiddenColumns.includes(t.columnId))?[].concat(e.hiddenColumns,[t.columnId]):e.hiddenColumns.filter(function(o){return o!==t.columnId});return c({},e,{hiddenColumns:i})}return t.type===u.setHiddenColumns?c({},e,{hiddenColumns:ie(t.value,e.hiddenColumns)}):t.type===u.toggleHideAllColumns?c({},e,{hiddenColumns:(t.value!==void 0?t.value:!e.hiddenColumns.length)?r.allColumns.map(function(o){return o.id}):[]}):void 0}function Wn(e){var t=e.headers,n=e.state.hiddenColumns;g.useRef(!1).current;var r=0;t.forEach(function(i){return r+=function o(a,s){a.isVisible=s&&!n.includes(a.id);var l=0;return a.headers&&a.headers.length?a.headers.forEach(function(d){return l+=o(d,a.isVisible)}):l=a.isVisible?1:0,a.totalVisibleHeaderCount=l,l}(i,!0)})}function _n(e){var t=e.columns,n=e.flatHeaders,r=e.dispatch,i=e.allColumns,o=e.getHooks,a=e.state.hiddenColumns,s=e.autoResetHiddenColumns,l=s===void 0||s,d=m(e),R=i.length===a.length,h=g.useCallback(function(P,E){return r({type:u.toggleHideColumn,columnId:P,value:E})},[r]),y=g.useCallback(function(P){return r({type:u.setHiddenColumns,value:P})},[r]),p=g.useCallback(function(P){return r({type:u.toggleHideAllColumns,value:P})},[r]),w=D(o().getToggleHideAllColumnsProps,{instance:d()});n.forEach(function(P){P.toggleHidden=function(E){r({type:u.toggleHideColumn,columnId:P.id,value:E})},P.getToggleHiddenProps=D(o().getToggleHiddenProps,{instance:d(),column:P})});var S=m(l);M(function(){S()&&r({type:u.resetHiddenColumns})},[r,t]),Object.assign(e,{allColumnsHidden:R,toggleHideColumn:h,setHiddenColumns:y,toggleHideAllColumns:p,getToggleHideAllColumnsProps:w})}var zn={},Mn={},jn=function(e,t,n){return e},Ln=function(e,t){return e.subRows||[]},Dn=function(e,t,n){return""+(n?[n.id,t].join("."):t)},Vn=function(e){return e};function Pt(e){var t=e.initialState,n=t===void 0?zn:t,r=e.defaultColumn,i=r===void 0?Mn:r,o=e.getSubRows,a=o===void 0?Ln:o,s=e.getRowId,l=s===void 0?Dn:s,d=e.stateReducer,R=d===void 0?jn:d,h=e.useControlledState,y=h===void 0?Vn:h;return c({},U(e,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:n,defaultColumn:i,getSubRows:a,getRowId:l,stateReducer:R,useControlledState:y})}function xt(e,t){t===void 0&&(t=0);var n=0,r=0,i=0,o=0;return e.forEach(function(a){var s=a.headers;if(a.totalLeft=t,s&&s.length){var l=xt(s,t),d=l[0],R=l[1],h=l[2],y=l[3];a.totalMinWidth=d,a.totalWidth=R,a.totalMaxWidth=h,a.totalFlexWidth=y}else a.totalMinWidth=a.minWidth,a.totalWidth=Math.min(Math.max(a.minWidth,a.width),a.maxWidth),a.totalMaxWidth=a.maxWidth,a.totalFlexWidth=a.canResize?a.totalWidth:0;a.isVisible&&(t+=a.totalWidth,n+=a.totalMinWidth,r+=a.totalWidth,i+=a.totalMaxWidth,o+=a.totalFlexWidth)}),[n,r,i,o]}function $n(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.column,a=e.getRowId,s=e.getSubRows,l=e.accessValueHooks,d=e.getInstance;t.forEach(function(R,h){return function y(p,w,S,P,E){S===void 0&&(S=0);var W=p,B=a(p,w,P),C=i[B];if(C)C.subRows&&C.originalSubRows.forEach(function(x,A){return y(x,A,S+1,C)});else if((C={id:B,original:W,index:w,depth:S,cells:[{}]}).cells.map=Te,C.cells.filter=Te,C.cells.forEach=Te,C.cells[0].getCellProps=Te,C.values={},E.push(C),r.push(C),i[B]=C,C.originalSubRows=s(p,w),C.originalSubRows){var N=[];C.originalSubRows.forEach(function(x,A){return y(x,A,S+1,C,N)}),C.subRows=N}o.accessor&&(C.values[o.id]=o.accessor(p,w,C,E,t)),C.values[o.id]=J(l,C.values[o.id],{row:C,column:o,instance:d()})}(R,h,0,void 0,n)})}u.resetExpanded="resetExpanded",u.toggleRowExpanded="toggleRowExpanded",u.toggleAllRowsExpanded="toggleAllRowsExpanded";var Bt=function(e){e.getToggleAllRowsExpandedProps=[Kn],e.getToggleRowExpandedProps=[Un],e.stateReducers.push(qn),e.useInstance.push(Xn),e.prepareRow.push(Qn)};Bt.pluginName="useExpanded";var Kn=function(e,t){var n=t.instance;return[e,{onClick:function(r){n.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},Un=function(e,t){var n=t.row;return[e,{onClick:function(){n.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function qn(e,t,n,r){if(t.type===u.init)return c({expanded:{}},e);if(t.type===u.resetExpanded)return c({},e,{expanded:r.initialState.expanded||{}});if(t.type===u.toggleAllRowsExpanded){var i=t.value,o=r.rowsById,a=Object.keys(o).length===Object.keys(e.expanded).length;if(i!==void 0?i:!a){var s={};return Object.keys(o).forEach(function(w){s[w]=!0}),c({},e,{expanded:s})}return c({},e,{expanded:{}})}if(t.type===u.toggleRowExpanded){var l,d=t.id,R=t.value,h=e.expanded[d],y=R!==void 0?R:!h;if(!h&&y)return c({},e,{expanded:c({},e.expanded,(l={},l[d]=!0,l))});if(h&&!y){var p=e.expanded;return p[d],c({},e,{expanded:U(p,[d].map(de))})}return e}}function Xn(e){var t=e.data,n=e.rows,r=e.rowsById,i=e.manualExpandedKey,o=i===void 0?"expanded":i,a=e.paginateExpandedRows,s=a===void 0||a,l=e.expandSubRows,d=l===void 0||l,R=e.autoResetExpanded,h=R===void 0||R,y=e.getHooks,p=e.plugins,w=e.state.expanded,S=e.dispatch;Z(p,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var P=m(h),E=Boolean(Object.keys(r).length&&Object.keys(w).length);E&&Object.keys(r).some(function(z){return!w[z]})&&(E=!1),M(function(){P()&&S({type:u.resetExpanded})},[S,t]);var W=g.useCallback(function(z,T){S({type:u.toggleRowExpanded,id:z,value:T})},[S]),B=g.useCallback(function(z){return S({type:u.toggleAllRowsExpanded,value:z})},[S]),C=g.useMemo(function(){return s?Ne(n,{manualExpandedKey:o,expanded:w,expandSubRows:d}):n},[s,n,o,w,d]),N=g.useMemo(function(){return function(z){var T=0;return Object.keys(z).forEach(function(k){var $=k.split(".");T=Math.max(T,$.length)}),T}(w)},[w]),x=m(e),A=D(y().getToggleAllRowsExpandedProps,{instance:x()});Object.assign(e,{preExpandedRows:n,expandedRows:C,rows:C,expandedDepth:N,isAllRowsExpanded:E,toggleRowExpanded:W,toggleAllRowsExpanded:B,getToggleAllRowsExpandedProps:A})}function Qn(e,t){var n=t.instance.getHooks,r=t.instance;e.toggleRowExpanded=function(i){return r.toggleRowExpanded(e.id,i)},e.getToggleRowExpandedProps=D(n().getToggleRowExpandedProps,{instance:r,row:e})}var Et=function(e,t,n){return e=e.filter(function(r){return t.some(function(i){var o=r.values[i];return String(o).toLowerCase().includes(String(n).toLowerCase())})})};Et.autoRemove=function(e){return!e};var It=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o===void 0||String(o).toLowerCase()===String(n).toLowerCase()})})};It.autoRemove=function(e){return!e};var Tt=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o===void 0||String(o)===String(n)})})};Tt.autoRemove=function(e){return!e};var Ft=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i].includes(n)})})};Ft.autoRemove=function(e){return!e||!e.length};var kt=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o&&o.length&&n.every(function(a){return o.includes(a)})})})};kt.autoRemove=function(e){return!e||!e.length};var At=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o&&o.length&&n.some(function(a){return o.includes(a)})})})};At.autoRemove=function(e){return!e||!e.length};var Gt=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return n.includes(o)})})};Gt.autoRemove=function(e){return!e||!e.length};var Ht=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i]===n})})};Ht.autoRemove=function(e){return e===void 0};var Nt=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i]==n})})};Nt.autoRemove=function(e){return e==null};var Ot=function(e,t,n){var r=n||[],i=r[0],o=r[1];if((i=typeof i=="number"?i:-1/0)>(o=typeof o=="number"?o:1/0)){var a=i;i=o,o=a}return e.filter(function(s){return t.some(function(l){var d=s.values[l];return d>=i&&d<=o})})};Ot.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var We=Object.freeze({__proto__:null,text:Et,exactText:It,exactTextCase:Tt,includes:Ft,includesAll:kt,includesSome:At,includesValue:Gt,exact:Ht,equals:Nt,between:Ot});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var Wt=function(e){e.stateReducers.push(Jn),e.useInstance.push(Yn)};function Jn(e,t,n,r){if(t.type===u.init)return c({filters:[]},e);if(t.type===u.resetFilters)return c({},e,{filters:r.initialState.filters||[]});if(t.type===u.setFilter){var i=t.columnId,o=t.filterValue,a=r.allColumns,s=r.filterTypes,l=a.find(function(S){return S.id===i});if(!l)throw new Error("React-Table: Could not find a column with id: "+i);var d=Se(l.filter,s||{},We),R=e.filters.find(function(S){return S.id===i}),h=ie(o,R&&R.value);return Ie(d.autoRemove,h,l)?c({},e,{filters:e.filters.filter(function(S){return S.id!==i})}):c({},e,R?{filters:e.filters.map(function(S){return S.id===i?{id:i,value:h}:S})}:{filters:[].concat(e.filters,[{id:i,value:h}])})}if(t.type===u.setAllFilters){var y=t.filters,p=r.allColumns,w=r.filterTypes;return c({},e,{filters:ie(y,e.filters).filter(function(S){var P=p.find(function(E){return E.id===S.id});return!Ie(Se(P.filter,w||{},We).autoRemove,S.value,P)})})}}function Yn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.manualFilters,l=e.defaultCanFilter,d=l!==void 0&&l,R=e.disableFilters,h=e.state.filters,y=e.dispatch,p=e.autoResetFilters,w=p===void 0||p,S=g.useCallback(function(x,A){y({type:u.setFilter,columnId:x,filterValue:A})},[y]),P=g.useCallback(function(x){y({type:u.setAllFilters,filters:x})},[y]);o.forEach(function(x){var A=x.id,z=x.accessor,T=x.defaultCanFilter,k=x.disableFilters;x.canFilter=z?ne(k!==!0&&void 0,R!==!0&&void 0,!0):ne(T,d,!1),x.setFilter=function(H){return S(x.id,H)};var $=h.find(function(H){return H.id===A});x.filterValue=$&&$.value});var E=g.useMemo(function(){if(s||!h.length)return[n,r,i];var x=[],A={};return[function z(T,k){k===void 0&&(k=0);var $=T;return($=h.reduce(function(H,V){var L=V.id,Q=V.value,I=o.find(function(te){return te.id===L});if(!I)return H;k===0&&(I.preFilteredRows=H);var j=Se(I.filter,a||{},We);return j?(I.filteredRows=j(H,[L],Q),I.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+I.id+"."),H)},T)).forEach(function(H){x.push(H),A[H.id]=H,H.subRows&&(H.subRows=H.subRows&&H.subRows.length>0?z(H.subRows,k+1):H.subRows)}),$}(n),x,A]},[s,h,n,r,i,o,a]),W=E[0],B=E[1],C=E[2];g.useMemo(function(){o.filter(function(x){return!h.find(function(A){return A.id===x.id})}).forEach(function(x){x.preFilteredRows=W,x.filteredRows=W})},[W,h,o]);var N=m(w);M(function(){N()&&y({type:u.resetFilters})},[y,s?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:W,filteredFlatRows:B,filteredRowsById:C,rows:W,flatRows:B,rowsById:C,setFilter:S,setAllFilters:P})}Wt.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var _t=function(e){e.stateReducers.push(Zn),e.useInstance.push(er)};function Zn(e,t,n,r){if(t.type===u.resetGlobalFilter)return c({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===u.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,a=Se(r.globalFilter,o||{},We),s=ie(i,e.globalFilter);return Ie(a.autoRemove,s)?(e.globalFilter,U(e,["globalFilter"])):c({},e,{globalFilter:s})}}function er(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.globalFilter,l=e.manualGlobalFilter,d=e.state.globalFilter,R=e.dispatch,h=e.autoResetGlobalFilter,y=h===void 0||h,p=e.disableGlobalFilter,w=g.useCallback(function(C){R({type:u.setGlobalFilter,filterValue:C})},[R]),S=g.useMemo(function(){if(l||d===void 0)return[n,r,i];var C=[],N={},x=Se(s,a||{},We);if(!x)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(z){var T=z.disableGlobalFilter;z.canFilter=ne(T!==!0&&void 0,p!==!0&&void 0,!0)});var A=o.filter(function(z){return z.canFilter===!0});return[function z(T){return(T=x(T,A.map(function(k){return k.id}),d)).forEach(function(k){C.push(k),N[k.id]=k,k.subRows=k.subRows&&k.subRows.length?z(k.subRows):k.subRows}),T}(n),C,N]},[l,d,s,a,o,n,r,i,p]),P=S[0],E=S[1],W=S[2],B=m(y);M(function(){B()&&R({type:u.resetGlobalFilter})},[R,l?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:P,globalFilteredFlatRows:E,globalFilteredRowsById:W,rows:P,flatRows:E,rowsById:W,setGlobalFilter:w,disableGlobalFilter:p})}function zt(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}_t.pluginName="useGlobalFilter";var Mt=Object.freeze({__proto__:null,sum:zt,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return zt(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),tr=[],nr={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var jt=function(e){e.getGroupByToggleProps=[rr],e.stateReducers.push(or),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(ir),e.useInstance.push(ur),e.prepareRow.push(sr)};jt.pluginName="useGroupBy";var rr=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function or(e,t,n,r){if(t.type===u.init)return c({groupBy:[]},e);if(t.type===u.resetGroupBy)return c({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===u.setGroupBy)return c({},e,{groupBy:t.value});if(t.type===u.toggleGroupBy){var i=t.columnId,o=t.value,a=o!==void 0?o:!e.groupBy.includes(i);return c({},e,a?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(s){return s!==i})})}}function ir(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(a){return a.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var ar={};function ur(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.flatHeaders,s=e.groupByFn,l=s===void 0?Lt:s,d=e.manualGroupBy,R=e.aggregations,h=R===void 0?ar:R,y=e.plugins,p=e.state.groupBy,w=e.dispatch,S=e.autoResetGroupBy,P=S===void 0||S,E=e.disableGroupBy,W=e.defaultCanGroupBy,B=e.getHooks;Z(y,["useColumnOrder","useFilters"],"useGroupBy");var C=m(e);o.forEach(function(I){var j=I.accessor,te=I.defaultGroupBy,pe=I.disableGroupBy;I.canGroupBy=j?ne(I.canGroupBy,pe!==!0&&void 0,E!==!0&&void 0,!0):ne(I.canGroupBy,te,W,!1),I.canGroupBy&&(I.toggleGroupBy=function(){return e.toggleGroupBy(I.id)}),I.Aggregated=I.Aggregated||I.Cell});var N=g.useCallback(function(I,j){w({type:u.toggleGroupBy,columnId:I,value:j})},[w]),x=g.useCallback(function(I){w({type:u.setGroupBy,value:I})},[w]);a.forEach(function(I){I.getGroupByToggleProps=D(B().getGroupByToggleProps,{instance:C(),header:I})});var A=g.useMemo(function(){if(d||!p.length)return[n,r,i,tr,nr,r,i];var I=p.filter(function(ue){return o.find(function(Pe){return Pe.id===ue})}),j=[],te={},pe=[],F={},Y=[],re={},ge=function ue(Pe,Re,un){if(Re===void 0&&(Re=0),Re===I.length)return Pe.map(function(Ue){return c({},Ue,{depth:Re})});var dt=I[Re],Qr=l(Pe,dt);return Object.entries(Qr).map(function(Ue,Jr){var sn=Ue[0],qe=Ue[1],Xe=dt+":"+sn,ln=ue(qe,Re+1,Xe=un?un+">"+Xe:Xe),cn=Re?Ee(qe,"leafRows"):qe,Yr=function(he,ft,eo){var Qe={};return o.forEach(function(oe){if(I.includes(oe.id))Qe[oe.id]=ft[0]?ft[0].values[oe.id]:null;else{var dn=typeof oe.aggregate=="function"?oe.aggregate:h[oe.aggregate]||Mt[oe.aggregate];if(dn){var to=ft.map(function(Je){return Je.values[oe.id]}),no=he.map(function(Je){var pt=Je.values[oe.id];if(!eo&&oe.aggregateValue){var fn=typeof oe.aggregateValue=="function"?oe.aggregateValue:h[oe.aggregateValue]||Mt[oe.aggregateValue];if(!fn)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregateValue option for column listed above");pt=fn(pt,Je,oe)}return pt});Qe[oe.id]=dn(no,to)}else{if(oe.aggregate)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregate option for column listed above");Qe[oe.id]=null}}}),Qe}(cn,qe,Re),Zr={id:Xe,isGrouped:!0,groupByID:dt,groupByVal:sn,values:Yr,subRows:ln,leafRows:cn,depth:Re,index:Jr};return ln.forEach(function(he){j.push(he),te[he.id]=he,he.isGrouped?(pe.push(he),F[he.id]=he):(Y.push(he),re[he.id]=he)}),Zr})}(n);return ge.forEach(function(ue){j.push(ue),te[ue.id]=ue,ue.isGrouped?(pe.push(ue),F[ue.id]=ue):(Y.push(ue),re[ue.id]=ue)}),[ge,j,te,pe,F,Y,re]},[d,p,n,r,i,o,h,l]),z=A[0],T=A[1],k=A[2],$=A[3],H=A[4],V=A[5],L=A[6],Q=m(P);M(function(){Q()&&w({type:u.resetGroupBy})},[w,d?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:z,groupedFlatRows:T,groupedRowsById:k,onlyGroupedFlatRows:$,onlyGroupedRowsById:H,nonGroupedFlatRows:V,nonGroupedRowsById:L,rows:z,flatRows:T,rowsById:k,toggleGroupBy:N,setGroupBy:x})}function sr(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Lt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var Dt=/([0-9]+)/gm;function it(e,t){return e===t?0:e>t?1:-1}function _e(e,t,n){return[e.values[n],t.values[n]]}function Vt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var lr=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];for(i=Vt(i),o=Vt(o),i=i.split(Dt).filter(Boolean),o=o.split(Dt).filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),l=parseInt(a,10),d=parseInt(s,10),R=[l,d].sort();if(isNaN(R[0])){if(a>s)return 1;if(s>a)return-1}else{if(isNaN(R[1]))return isNaN(l)?-1:1;if(l>d)return 1;if(d>l)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];return it(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=_e(e,t,n);return it(r[0],r[1])},string:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),l=a.toLowerCase(),d=s.toLowerCase();if(l>d)return 1;if(d>l)return-1;if(a>s)return 1;if(s>a)return-1}return i.length-o.length},number:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1],a=/[^0-9.]/gi;return it(i=Number(String(i).replace(a,"")),o=Number(String(o).replace(a,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",le.sortType="alphanumeric",le.sortDescFirst=!1;var $t=function(e){e.getSortByToggleProps=[cr],e.stateReducers.push(dr),e.useInstance.push(fr)};$t.pluginName="useSortBy";var cr=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(a){return a.shiftKey}:i;return[e,{onClick:r.canSort?function(a){a.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(a))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function dr(e,t,n,r){if(t.type===u.init)return c({sortBy:[]},e);if(t.type===u.resetSortBy)return c({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===u.clearSortBy)return c({},e,{sortBy:e.sortBy.filter(function(C){return C.id!==t.columnId})});if(t.type===u.setSortBy)return c({},e,{sortBy:t.sortBy});if(t.type===u.toggleSortBy){var i,o=t.columnId,a=t.desc,s=t.multi,l=r.allColumns,d=r.disableMultiSort,R=r.disableSortRemove,h=r.disableMultiRemove,y=r.maxMultiSortColCount,p=y===void 0?Number.MAX_SAFE_INTEGER:y,w=e.sortBy,S=l.find(function(C){return C.id===o}).sortDescFirst,P=w.find(function(C){return C.id===o}),E=w.findIndex(function(C){return C.id===o}),W=a!=null,B=[];return(i=!d&&s?P?"toggle":"add":E!==w.length-1||w.length!==1?"replace":P?"toggle":"replace")!="toggle"||R||W||s&&h||!(P&&P.desc&&!S||!P.desc&&S)||(i="remove"),i==="replace"?B=[{id:o,desc:W?a:S}]:i==="add"?(B=[].concat(w,[{id:o,desc:W?a:S}])).splice(0,B.length-p):i==="toggle"?B=w.map(function(C){return C.id===o?c({},C,{desc:W?a:!P.desc}):C}):i==="remove"&&(B=w.filter(function(C){return C.id!==o})),c({},e,{sortBy:B})}}function fr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,a=o===void 0?Kt:o,s=e.sortTypes,l=e.manualSortBy,d=e.defaultCanSort,R=e.disableSortBy,h=e.flatHeaders,y=e.state.sortBy,p=e.dispatch,w=e.plugins,S=e.getHooks,P=e.autoResetSortBy,E=P===void 0||P;Z(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var W=g.useCallback(function(T){p({type:u.setSortBy,sortBy:T})},[p]),B=g.useCallback(function(T,k,$){p({type:u.toggleSortBy,columnId:T,desc:k,multi:$})},[p]),C=m(e);h.forEach(function(T){var k=T.accessor,$=T.canSort,H=T.disableSortBy,V=T.id,L=k?ne(H!==!0&&void 0,R!==!0&&void 0,!0):ne(d,$,!1);T.canSort=L,T.canSort&&(T.toggleSortBy=function(I,j){return B(T.id,I,j)},T.clearSortBy=function(){p({type:u.clearSortBy,columnId:T.id})}),T.getSortByToggleProps=D(S().getSortByToggleProps,{instance:C(),column:T});var Q=y.find(function(I){return I.id===V});T.isSorted=!!Q,T.sortedIndex=y.findIndex(function(I){return I.id===V}),T.isSortedDesc=T.isSorted?Q.desc:void 0});var N=g.useMemo(function(){if(l||!y.length)return[n,r];var T=[],k=y.filter(function($){return i.find(function(H){return H.id===$.id})});return[function $(H){var V=a(H,k.map(function(L){var Q=i.find(function(te){return te.id===L.id});if(!Q)throw new Error("React-Table: Could not find a column with id: "+L.id+" while sorting");var I=Q.sortType,j=Ge(I)||(s||{})[I]||lr[I];if(!j)throw new Error("React-Table: Could not find a valid sortType of '"+I+"' for column '"+L.id+"'.");return function(te,pe){return j(te,pe,L.id,L.desc)}}),k.map(function(L){var Q=i.find(function(I){return I.id===L.id});return Q&&Q.sortInverted?L.desc:!L.desc}));return V.forEach(function(L){T.push(L),L.subRows&&L.subRows.length!==0&&(L.subRows=$(L.subRows))}),V}(n),T]},[l,y,n,r,i,a,s]),x=N[0],A=N[1],z=m(E);M(function(){z()&&p({type:u.resetSortBy})},[l?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:x,sortedFlatRows:A,rows:x,flatRows:A,setSortBy:W,toggleSortBy:B})}function Kt(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;o<t.length;o+=1){var a=t[o],s=n[o]===!1||n[o]==="desc",l=a(r,i);if(l!==0)return s?-l:l}return n[0]?r.index-i.index:i.index-r.index})}u.resetPage="resetPage",u.gotoPage="gotoPage",u.setPageSize="setPageSize";var Ut=function(e){e.stateReducers.push(pr),e.useInstance.push(gr)};function pr(e,t,n,r){if(t.type===u.init)return c({pageSize:10,pageIndex:0},e);if(t.type===u.resetPage)return c({},e,{pageIndex:r.initialState.pageIndex||0});if(t.type===u.gotoPage){var i=r.pageCount,o=r.page,a=ie(t.pageIndex,e.pageIndex),s=!1;return a>e.pageIndex?s=i===-1?o.length>=e.pageSize:a<i:a<e.pageIndex&&(s=a>-1),s?c({},e,{pageIndex:a}):e}if(t.type===u.setPageSize){var l=t.pageSize,d=e.pageSize*e.pageIndex;return c({},e,{pageIndex:Math.floor(d/l),pageSize:l})}}function gr(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,a=e.plugins,s=e.pageCount,l=e.paginateExpandedRows,d=l===void 0||l,R=e.expandSubRows,h=R===void 0||R,y=e.state,p=y.pageSize,w=y.pageIndex,S=y.expanded,P=y.globalFilter,E=y.filters,W=y.groupBy,B=y.sortBy,C=e.dispatch,N=e.data,x=e.manualPagination;Z(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var A=m(r);M(function(){A()&&C({type:u.resetPage})},[C,x?null:N,P,E,W,B]);var z=x?s:Math.ceil(t.length/p),T=g.useMemo(function(){return z>0?[].concat(new Array(z)).fill(null).map(function(j,te){return te}):[]},[z]),k=g.useMemo(function(){var j;if(x)j=t;else{var te=p*w,pe=te+p;j=t.slice(te,pe)}return d?j:Ne(j,{manualExpandedKey:o,expanded:S,expandSubRows:h})},[h,S,o,x,w,p,d,t]),$=w>0,H=z===-1?k.length>=p:w<z-1,V=g.useCallback(function(j){C({type:u.gotoPage,pageIndex:j})},[C]),L=g.useCallback(function(){return V(function(j){return j-1})},[V]),Q=g.useCallback(function(){return V(function(j){return j+1})},[V]),I=g.useCallback(function(j){C({type:u.setPageSize,pageSize:j})},[C]);Object.assign(e,{pageOptions:T,pageCount:z,page:k,canPreviousPage:$,canNextPage:H,gotoPage:V,previousPage:L,nextPage:Q,setPageSize:I})}Ut.pluginName="usePagination",u.resetPivot="resetPivot",u.togglePivot="togglePivot";var qt=function(e){e.getPivotToggleProps=[vr],e.stateReducers.push(mr),e.useInstanceAfterData.push(hr),e.allColumns.push(yr),e.accessValue.push(wr),e.materializedColumns.push(br),e.materializedColumnsDeps.push(Rr),e.visibleColumns.push(Cr),e.visibleColumnsDeps.push(Sr),e.useInstance.push(Pr),e.prepareRow.push(xr)};qt.pluginName="usePivotColumns";var Xt=[],vr=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(r){r.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function mr(e,t,n,r){if(t.type===u.init)return c({pivotColumns:Xt},e);if(t.type===u.resetPivot)return c({},e,{pivotColumns:r.initialState.pivotColumns||Xt});if(t.type===u.togglePivot){var i=t.columnId,o=t.value,a=o!==void 0?o:!e.pivotColumns.includes(i);return c({},e,a?{pivotColumns:[].concat(e.pivotColumns,[i])}:{pivotColumns:e.pivotColumns.filter(function(s){return s!==i})})}}function hr(e){e.allColumns.forEach(function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)})}function yr(e,t){var n=t.instance;return e.forEach(function(r){r.isPivotSource=n.state.pivotColumns.includes(r.id),r.uniqueValues=new Set}),e}function wr(e,t){var n=t.column;return n.uniqueValues&&e!==void 0&&n.uniqueValues.add(e),e}function br(e,t){var n=t.instance,r=n.allColumns,i=n.state;if(!i.pivotColumns.length||!i.groupBy||!i.groupBy.length)return e;var o=i.pivotColumns.map(function(l){return r.find(function(d){return d.id===l})}).filter(Boolean),a=r.filter(function(l){return!l.isPivotSource&&!i.groupBy.includes(l.id)&&!i.pivotColumns.includes(l.id)}),s=Be(function l(d,R,h){d===void 0&&(d=0),h===void 0&&(h=[]);var y=o[d];return y?Array.from(y.uniqueValues).sort().map(function(p){var w=c({},y,{Header:y.PivotHeader||typeof y.header=="string"?y.Header+": "+p:p,isPivotGroup:!0,parent:R,depth:d,id:R?R.id+"."+y.id+"."+p:y.id+"."+p,pivotValue:p});return w.columns=l(d+1,w,[].concat(h,[function(S){return S.values[y.id]===p}])),w}):a.map(function(p){return c({},p,{canPivot:!1,isPivoted:!0,parent:R,depth:d,id:""+(R?R.id+"."+p.id:p.id),accessor:function(w,S,P){if(h.every(function(E){return E(P)}))return P.values[p.id]}})})}());return[].concat(e,s)}function Rr(e,t){var n=t.instance.state,r=n.pivotColumns,i=n.groupBy;return[].concat(e,[r,i])}function Cr(e,t){var n=t.instance.state;return e=e.filter(function(r){return!r.isPivotSource}),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter(function(r){return r.isGrouped||r.isPivoted})),e}function Sr(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function Pr(e){var t=e.columns,n=e.allColumns,r=e.flatHeaders,i=e.getHooks,o=e.plugins,a=e.dispatch,s=e.autoResetPivot,l=s===void 0||s,d=e.manaulPivot,R=e.disablePivot,h=e.defaultCanPivot;Z(o,["useGroupBy"],"usePivotColumns");var y=m(e);n.forEach(function(w){var S=w.accessor,P=w.defaultPivot,E=w.disablePivot;w.canPivot=S?ne(w.canPivot,E!==!0&&void 0,R!==!0&&void 0,!0):ne(w.canPivot,P,h,!1),w.canPivot&&(w.togglePivot=function(){return e.togglePivot(w.id)}),w.Aggregated=w.Aggregated||w.Cell}),r.forEach(function(w){w.getPivotToggleProps=D(i().getPivotToggleProps,{instance:y(),header:w})});var p=m(l);M(function(){p()&&a({type:u.resetPivot})},[a,d?null:t]),Object.assign(e,{togglePivot:function(w,S){a({type:u.togglePivot,columnId:w,value:S})}})}function xr(e){e.allCells.forEach(function(t){t.isPivoted=t.column.isPivoted})}u.resetSelectedRows="resetSelectedRows",u.toggleAllRowsSelected="toggleAllRowsSelected",u.toggleRowSelected="toggleRowSelected",u.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var Qt=function(e){e.getToggleRowSelectedProps=[Br],e.getToggleAllRowsSelectedProps=[Er],e.getToggleAllPageRowsSelectedProps=[Ir],e.stateReducers.push(Tr),e.useInstance.push(Fr),e.prepareRow.push(kr)};Qt.pluginName="useRowSelect";var Br=function(e,t){var n=t.instance,r=t.row,i=n.manualRowSelectedKey,o=i===void 0?"isSelected":i;return[e,{onChange:function(a){r.toggleRowSelected(a.target.checked)},style:{cursor:"pointer"},checked:!(!r.original||!r.original[o])||r.isSelected,title:"Toggle Row Selected",indeterminate:r.isSomeSelected}]},Er=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},Ir=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllPageRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some(function(r){var i=r.id;return n.state.selectedRowIds[i]}))}]};function Tr(e,t,n,r){if(t.type===u.init)return c({selectedRowIds:{}},e);if(t.type===u.resetSelectedRows)return c({},e,{selectedRowIds:r.initialState.selectedRowIds||{}});if(t.type===u.toggleAllRowsSelected){var i=t.value,o=r.isAllRowsSelected,a=r.rowsById,s=r.nonGroupedRowsById,l=s===void 0?a:s,d=i!==void 0?i:!o,R=Object.assign({},e.selectedRowIds);return d?Object.keys(l).forEach(function(V){R[V]=!0}):Object.keys(l).forEach(function(V){delete R[V]}),c({},e,{selectedRowIds:R})}if(t.type===u.toggleRowSelected){var h=t.id,y=t.value,p=r.rowsById,w=r.selectSubRows,S=w===void 0||w,P=r.getSubRows,E=e.selectedRowIds[h],W=y!==void 0?y:!E;if(E===W)return e;var B=c({},e.selectedRowIds);return function V(L){var Q=p[L];if(Q&&(Q.isGrouped||(W?B[L]=!0:delete B[L]),S&&P(Q)))return P(Q).forEach(function(I){return V(I.id)})}(h),c({},e,{selectedRowIds:B})}if(t.type===u.toggleAllPageRowsSelected){var C=t.value,N=r.page,x=r.rowsById,A=r.selectSubRows,z=A===void 0||A,T=r.isAllPageRowsSelected,k=r.getSubRows,$=C!==void 0?C:!T,H=c({},e.selectedRowIds);return N.forEach(function(V){return function L(Q){var I=x[Q];if(I.isGrouped||($?H[Q]=!0:delete H[Q]),z&&k(I))return k(I).forEach(function(j){return L(j.id)})}(V.id)}),c({},e,{selectedRowIds:H})}return e}function Fr(e){var t=e.data,n=e.rows,r=e.getHooks,i=e.plugins,o=e.rowsById,a=e.nonGroupedRowsById,s=a===void 0?o:a,l=e.autoResetSelectedRows,d=l===void 0||l,R=e.state.selectedRowIds,h=e.selectSubRows,y=h===void 0||h,p=e.dispatch,w=e.page,S=e.getSubRows;Z(i,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var P=g.useMemo(function(){var k=[];return n.forEach(function($){var H=y?function V(L,Q,I){if(Q[L.id])return!0;var j=I(L);if(j&&j.length){var te=!0,pe=!1;return j.forEach(function(F){pe&&!te||(V(F,Q,I)?pe=!0:te=!1)}),!!te||!!pe&&null}return!1}($,R,S):!!R[$.id];$.isSelected=!!H,$.isSomeSelected=H===null,H&&k.push($)}),k},[n,y,R,S]),E=Boolean(Object.keys(s).length&&Object.keys(R).length),W=E;E&&Object.keys(s).some(function(k){return!R[k]})&&(E=!1),E||w&&w.length&&w.some(function(k){var $=k.id;return!R[$]})&&(W=!1);var B=m(d);M(function(){B()&&p({type:u.resetSelectedRows})},[p,t]);var C=g.useCallback(function(k){return p({type:u.toggleAllRowsSelected,value:k})},[p]),N=g.useCallback(function(k){return p({type:u.toggleAllPageRowsSelected,value:k})},[p]),x=g.useCallback(function(k,$){return p({type:u.toggleRowSelected,id:k,value:$})},[p]),A=m(e),z=D(r().getToggleAllRowsSelectedProps,{instance:A()}),T=D(r().getToggleAllPageRowsSelectedProps,{instance:A()});Object.assign(e,{selectedFlatRows:P,isAllRowsSelected:E,isAllPageRowsSelected:W,toggleRowSelected:x,toggleAllRowsSelected:C,getToggleAllRowsSelectedProps:z,getToggleAllPageRowsSelectedProps:T,toggleAllPageRowsSelected:N})}function kr(e,t){var n=t.instance;e.toggleRowSelected=function(r){return n.toggleRowSelected(e.id,r)},e.getToggleRowSelectedProps=D(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var Jt=function(e){return{}},Yt=function(e){return{}};u.setRowState="setRowState",u.setCellState="setCellState",u.resetRowState="resetRowState";var Zt=function(e){e.stateReducers.push(Ar),e.useInstance.push(Gr),e.prepareRow.push(Hr)};function Ar(e,t,n,r){var i=r.initialRowStateAccessor,o=i===void 0?Jt:i,a=r.initialCellStateAccessor,s=a===void 0?Yt:a,l=r.rowsById;if(t.type===u.init)return c({rowState:{}},e);if(t.type===u.resetRowState)return c({},e,{rowState:r.initialState.rowState||{}});if(t.type===u.setRowState){var d,R=t.rowId,h=t.value,y=e.rowState[R]!==void 0?e.rowState[R]:o(l[R]);return c({},e,{rowState:c({},e.rowState,(d={},d[R]=ie(h,y),d))})}if(t.type===u.setCellState){var p,w,S,P,E,W=t.rowId,B=t.columnId,C=t.value,N=e.rowState[W]!==void 0?e.rowState[W]:o(l[W]),x=(N==null||(p=N.cellState)==null?void 0:p[B])!==void 0?N.cellState[B]:s((w=l[W])==null||(S=w.cells)==null?void 0:S.find(function(A){return A.column.id===B}));return c({},e,{rowState:c({},e.rowState,(E={},E[W]=c({},N,{cellState:c({},N.cellState||{},(P={},P[B]=ie(C,x),P))}),E))})}}function Gr(e){var t=e.autoResetRowState,n=t===void 0||t,r=e.data,i=e.dispatch,o=g.useCallback(function(l,d){return i({type:u.setRowState,rowId:l,value:d})},[i]),a=g.useCallback(function(l,d,R){return i({type:u.setCellState,rowId:l,columnId:d,value:R})},[i]),s=m(n);M(function(){s()&&i({type:u.resetRowState})},[r]),Object.assign(e,{setRowState:o,setCellState:a})}function Hr(e,t){var n=t.instance,r=n.initialRowStateAccessor,i=r===void 0?Jt:r,o=n.initialCellStateAccessor,a=o===void 0?Yt:o,s=n.state.rowState;e&&(e.state=s[e.id]!==void 0?s[e.id]:i(e),e.setState=function(l){return n.setRowState(e.id,l)},e.cells.forEach(function(l){e.state.cellState||(e.state.cellState={}),l.state=e.state.cellState[l.column.id]!==void 0?e.state.cellState[l.column.id]:a(l),l.setState=function(d){return n.setCellState(e.id,l.column.id,d)}}))}Zt.pluginName="useRowState",u.resetColumnOrder="resetColumnOrder",u.setColumnOrder="setColumnOrder";var en=function(e){e.stateReducers.push(Nr),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.columnOrder])}),e.visibleColumns.push(Or),e.useInstance.push(Wr)};function Nr(e,t,n,r){return t.type===u.init?c({columnOrder:[]},e):t.type===u.resetColumnOrder?c({},e,{columnOrder:r.initialState.columnOrder||[]}):t.type===u.setColumnOrder?c({},e,{columnOrder:ie(t.columnOrder,e.columnOrder)}):void 0}function Or(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var r=[].concat(n),i=[].concat(e),o=[],a=function(){var s=r.shift(),l=i.findIndex(function(d){return d.id===s});l>-1&&o.push(i.splice(l,1)[0])};i.length&&r.length;)a();return[].concat(o,i)}function Wr(e){var t=e.dispatch;e.setColumnOrder=g.useCallback(function(n){return t({type:u.setColumnOrder,columnOrder:n})},[t])}en.pluginName="useColumnOrder",le.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var tn=function(e){e.getResizerProps=[_r],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(zr),e.useInstance.push(jr),e.useInstanceBeforeDimensions.push(Mr)},_r=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(a,s){var l=!1;if(a.type==="touchstart"){if(a.touches&&a.touches.length>1)return;l=!0}var d,R,h=function(B){var C=[];return function N(x){x.columns&&x.columns.length&&x.columns.map(N),C.push(x)}(B),C}(s).map(function(B){return[B.id,B.totalWidth]}),y=l?Math.round(a.touches[0].clientX):a.clientX,p=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnDoneResizing})},w=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnResizing,clientX:R})},S=function(B){R=B,d||(d=window.requestAnimationFrame(w))},P={mouse:{moveEvent:"mousemove",moveHandler:function(B){return S(B.clientX)},upEvent:"mouseup",upHandler:function(B){document.removeEventListener("mousemove",P.mouse.moveHandler),document.removeEventListener("mouseup",P.mouse.upHandler),p()}},touch:{moveEvent:"touchmove",moveHandler:function(B){return B.cancelable&&(B.preventDefault(),B.stopPropagation()),S(B.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(B){document.removeEventListener(P.touch.moveEvent,P.touch.moveHandler),document.removeEventListener(P.touch.upEvent,P.touch.moveHandler),p()}}},E=l?P.touch:P.mouse,W=!!function(){if(typeof Fe=="boolean")return Fe;var B=!1;try{var C={get passive(){return B=!0,!1}};window.addEventListener("test",null,C),window.removeEventListener("test",null,C)}catch{B=!1}return Fe=B}()&&{passive:!1};document.addEventListener(E.moveEvent,E.moveHandler,W),document.addEventListener(E.upEvent,E.upHandler,W),i({type:u.columnStartResizing,columnId:s.id,columnWidth:s.totalWidth,headerIdWidths:h,clientX:y})};return[e,{onMouseDown:function(a){return a.persist()||o(a,r)},onTouchStart:function(a){return a.persist()||o(a,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function zr(e,t){if(t.type===u.init)return c({columnResizing:{columnWidths:{}}},e);if(t.type===u.resetResize)return c({},e,{columnResizing:{columnWidths:{}}});if(t.type===u.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return c({},e,{columnResizing:c({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===u.columnResizing){var a=t.clientX,s=e.columnResizing,l=s.startX,d=s.columnWidth,R=s.headerIdWidths,h=(a-l)/d,y={};return(R===void 0?[]:R).forEach(function(p){var w=p[0],S=p[1];y[w]=Math.max(S+S*h,0)}),c({},e,{columnResizing:c({},e.columnResizing,{columnWidths:c({},e.columnResizing.columnWidths,{},y)})})}return t.type===u.columnDoneResizing?c({},e,{columnResizing:c({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}tn.pluginName="useResizeColumns";var Mr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=m(e);t.forEach(function(a){var s=ne(a.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);a.canResize=s,a.width=i.columnWidths[a.id]||a.originalWidth||a.width,a.isResizing=i.isResizingColumn===a.id,s&&(a.getResizerProps=D(r().getResizerProps,{instance:o(),header:a}))})};function jr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;Z(t,["useAbsoluteLayout"],"useResizeColumns");var a=m(i);M(function(){a()&&n({type:u.resetResize})},[o]);var s=g.useCallback(function(){return n({type:u.resetResize})},[n]);Object.assign(e,{resetResizing:s})}var at={position:"absolute",top:0},nn=function(e){e.getTableBodyProps.push(Ke),e.getRowProps.push(Ke),e.getHeaderGroupProps.push(Ke),e.getFooterGroupProps.push(Ke),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},at,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};nn.pluginName="useAbsoluteLayout";var Ke=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},ut={display:"inline-block",boxSizing:"border-box"},st=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},rn=function(e){e.getRowProps.push(st),e.getHeaderGroupProps.push(st),e.getFooterGroupProps.push(st),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},ut,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},ut,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},ut,{width:r.totalWidth+"px"})}]})};function on(e){e.getTableProps.push(Lr),e.getRowProps.push(lt),e.getHeaderGroupProps.push(lt),e.getFooterGroupProps.push(lt),e.getHeaderProps.push(Dr),e.getCellProps.push(Vr),e.getFooterProps.push($r)}rn.pluginName="useBlockLayout",on.pluginName="useFlexLayout";var Lr=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},lt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Dr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Vr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},$r=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function an(e){e.stateReducers.push(Xr),e.getTableProps.push(Kr),e.getHeaderProps.push(Ur),e.getRowProps.push(qr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",an.pluginName="useGridLayout";var Kr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},Ur=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},qr=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Xr(e,t,n,r){if(t.type===u.init)return c({gridLayout:{columnWidths:{}}},e);if(t.type===u.resetResize)return c({},e,{gridLayout:{columnWidths:{}}});if(t.type===u.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,a=ct(i);if(a!==void 0){var s=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=ct(N.id),x))},{}),l=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=N.minWidth,x))},{}),d=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=N.maxWidth,x))},{}),R=o.map(function(C){var N=C[0];return[N,ct(N)]});return c({},e,{gridLayout:c({},e.gridLayout,{startWidths:s,minWidths:l,maxWidths:d,headerIdGridWidths:R,columnWidth:a})})}return e}if(t.type===u.columnResizing){var h=t.clientX,y=e.columnResizing.startX,p=e.gridLayout,w=p.columnWidth,S=p.minWidths,P=p.maxWidths,E=p.headerIdGridWidths,W=(h-y)/w,B={};return(E===void 0?[]:E).forEach(function(C){var N=C[0],x=C[1];B[N]=Math.min(Math.max(S[N],x+x*W),P[N])}),c({},e,{gridLayout:c({},e.gridLayout,{columnWidths:c({},e.gridLayout.columnWidths,{},B)})})}return t.type===u.columnDoneResizing?c({},e,{gridLayout:c({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function ct(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}f._UNSTABLE_usePivotColumns=qt,f.actions=u,f.defaultColumn=le,f.defaultGroupByFn=Lt,f.defaultOrderByFn=Kt,f.defaultRenderer=X,f.emptyRenderer=ee,f.ensurePluginOrder=Z,f.flexRender=ae,f.functionalUpdate=ie,f.loopHooks=ce,f.makePropGetter=D,f.makeRenderer=K,f.reduceHooks=J,f.safeUseLayoutEffect=G,f.useAbsoluteLayout=nn,f.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=g.useRef({}),r=m(e),i=m(t);return g.useCallback(function(){var o=_(regeneratorRuntime.mark(function a(){var s,l,d,R=arguments;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(s=R.length,l=new Array(s),d=0;d<s;d++)l[d]=R[d];return n.current.promise||(n.current.promise=new Promise(function(y,p){n.current.resolve=y,n.current.reject=p})),n.current.timeout&&clearTimeout(n.current.timeout),n.current.timeout=setTimeout(_(regeneratorRuntime.mark(function y(){return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return delete n.current.timeout,p.prev=1,p.t0=n.current,p.next=5,r().apply(void 0,l);case 5:p.t1=p.sent,p.t0.resolve.call(p.t0,p.t1),p.next=12;break;case 9:p.prev=9,p.t2=p.catch(1),n.current.reject(p.t2);case 12:return p.prev=12,delete n.current.promise,p.finish(12);case 15:case"end":return p.stop()}},y,null,[[1,9,12,15]])})),i()),h.abrupt("return",n.current.promise);case 5:case"end":return h.stop()}},a)}));return function(){return o.apply(this,arguments)}}(),[r,i])},f.useBlockLayout=rn,f.useColumnOrder=en,f.useExpanded=Bt,f.useFilters=Wt,f.useFlexLayout=on,f.useGetLatest=m,f.useGlobalFilter=_t,f.useGridLayout=an,f.useGroupBy=jt,f.useMountedLayoutEffect=M,f.usePagination=Ut,f.useResizeColumns=tn,f.useRowSelect=Qt,f.useRowState=Zt,f.useSortBy=$t,f.useTable=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e=Pt(e),n=[St].concat(n);var i=g.useRef({}),o=m(i.current);Object.assign(o(),c({},e,{plugins:n,hooks:Gn()})),n.filter(Boolean).forEach(function(F){F(o().hooks)});var a=m(o().hooks);o().getHooks=a,delete o().hooks,Object.assign(o(),J(a().useOptions,Pt(e)));var s=o(),l=s.data,d=s.columns,R=s.initialState,h=s.defaultColumn,y=s.getSubRows,p=s.getRowId,w=s.stateReducer,S=s.useControlledState,P=m(w),E=g.useCallback(function(F,Y){if(!Y.type)throw console.info({action:Y}),new Error("Unknown Action \u{1F446}");return[].concat(a().stateReducers,Array.isArray(P())?P():[P()]).reduce(function(re,ge){return ge(re,Y,F,o())||re},F)},[a,P,o]),W=g.useReducer(E,void 0,function(){return E(R,{type:u.init})}),B=W[0],C=W[1],N=J([].concat(a().useControlledState,[S]),B,{instance:o()});Object.assign(o(),{state:N,dispatch:C});var x=g.useMemo(function(){return ve(J(a().columns,d,{instance:o()}))},[a,o,d].concat(J(a().columnsDeps,[],{instance:o()})));o().columns=x;var A=g.useMemo(function(){return J(a().allColumns,Be(x),{instance:o()}).map(me)},[x,a,o].concat(J(a().allColumnsDeps,[],{instance:o()})));o().allColumns=A;var z=g.useMemo(function(){for(var F=[],Y=[],re={},ge=[].concat(A);ge.length;){var ue=ge.shift();$n({data:l,rows:F,flatRows:Y,rowsById:re,column:ue,getRowId:p,getSubRows:y,accessValueHooks:a().accessValue,getInstance:o})}return[F,Y,re]},[A,l,p,y,a,o]),T=z[0],k=z[1],$=z[2];Object.assign(o(),{rows:T,initialRows:[].concat(T),flatRows:k,rowsById:$}),ce(a().useInstanceAfterData,o());var H=g.useMemo(function(){return J(a().visibleColumns,A,{instance:o()}).map(function(F){return Ce(F,h)})},[a,A,o,h].concat(J(a().visibleColumnsDeps,[],{instance:o()})));A=g.useMemo(function(){var F=[].concat(H);return A.forEach(function(Y){F.find(function(re){return re.id===Y.id})||F.push(Y)}),F},[A,H]),o().allColumns=A;var V=g.useMemo(function(){return J(a().headerGroups,we(H,h),o())},[a,H,h,o].concat(J(a().headerGroupsDeps,[],{instance:o()})));o().headerGroups=V;var L=g.useMemo(function(){return V.length?V[0].headers:[]},[V]);o().headers=L,o().flatHeaders=V.reduce(function(F,Y){return[].concat(F,Y.headers)},[]),ce(a().useInstanceBeforeDimensions,o());var Q=H.filter(function(F){return F.isVisible}).map(function(F){return F.id}).sort().join("_");H=g.useMemo(function(){return H.filter(function(F){return F.isVisible})},[H,Q]),o().visibleColumns=H;var I=xt(L),j=I[0],te=I[1],pe=I[2];return o().totalColumnsMinWidth=j,o().totalColumnsWidth=te,o().totalColumnsMaxWidth=pe,ce(a().useInstance,o()),[].concat(o().flatHeaders,o().allColumns).forEach(function(F){F.render=K(o(),F),F.getHeaderProps=D(a().getHeaderProps,{instance:o(),column:F}),F.getFooterProps=D(a().getFooterProps,{instance:o(),column:F})}),o().headerGroups=g.useMemo(function(){return V.filter(function(F,Y){return F.headers=F.headers.filter(function(re){return re.headers?function ge(ue){return ue.filter(function(Pe){return Pe.headers?ge(Pe.headers):Pe.isVisible}).length}(re.headers):re.isVisible}),!!F.headers.length&&(F.getHeaderGroupProps=D(a().getHeaderGroupProps,{instance:o(),headerGroup:F,index:Y}),F.getFooterGroupProps=D(a().getFooterGroupProps,{instance:o(),headerGroup:F,index:Y}),!0)})},[V,o,a]),o().footerGroups=[].concat(o().headerGroups).reverse(),o().prepareRow=g.useCallback(function(F){F.getRowProps=D(a().getRowProps,{instance:o(),row:F}),F.allCells=A.map(function(Y){var re=F.values[Y.id],ge={column:Y,row:F,value:re};return ge.getCellProps=D(a().getCellProps,{instance:o(),cell:ge}),ge.render=K(o(),Y,{row:F,cell:ge,value:re}),ge}),F.cells=H.map(function(Y){return F.allCells.find(function(re){return re.column.id===Y.id})}),ce(a().prepareRow,F,{instance:o()})},[a,o,A,H]),o().getTableProps=D(a().getTableProps,{instance:o()}),o().getTableBodyProps=D(a().getTableBodyProps,{instance:o()}),ce(a().useFinalInstance,o()),o()},Object.defineProperty(f,"__esModule",{value:!0})})})(ht,ht.exports);(function(b){b.exports=ht.exports})(mt);const Vo="_tr_daq0k_1",$o="_th_daq0k_6",Ko="_td_daq0k_23",Uo="_odd_daq0k_29",qo="_du_daq0k_34",Xo="_sortIconContainer_daq0k_38",Qo="_rotate180_daq0k_45",xe={tr:Vo,th:$o,td:Ko,odd:Uo,du:qo,sortIconContainer:Xo,rotate180:Qo},ze=!0,Bn=[{accessor:"id",show:!1},{Header:"Host",accessor:"host"},{Header:"Process",accessor:"process"},{Header:"DL",accessor:"download",sortDescFirst:ze},{Header:"UL",accessor:"upload",sortDescFirst:ze},{Header:"DL Speed",accessor:"downloadSpeedCurr",sortDescFirst:ze},{Header:"UL Speed",accessor:"uploadSpeedCurr",sortDescFirst:ze},{Header:"Chains",accessor:"chains"},{Header:"Rule",accessor:"rule"},{Header:"Time",accessor:"start",sortDescFirst:ze},{Header:"Source",accessor:"source"},{Header:"Destination IP",accessor:"destinationIP"},{Header:"Type",accessor:"type"}],Jo=Bn,Yo=Bn.filter(b=>b.accessor!=="process");function Zo(b){switch(b.column.id){case"start":return ho(b.value,0);case"download":case"upload":return pn(b.value);case"downloadSpeedCurr":case"uploadSpeedCurr":return pn(b.value)+"/s";default:return b.value}}const ei={id:"id",desc:!0},ti={sortBy:[ei],hiddenColumns:["id"]};function ni({data:b}){const v=be.useContext(Cn),{getTableProps:f,headerGroups:g,rows:O,prepareRow:_}=mt.exports.useTable({columns:v.hasProcessPath?Jo:Yo,data:b,initialState:ti,autoResetSortBy:!1},mt.exports.useSortBy);return q("div",{...f(),style:{"--col-count":v.hasProcessPath?"12":"11"},children:g.map(c=>ye("div",{...c.getHeaderGroupProps(),className:xe.tr,children:[c.headers.map(U=>ye("div",{...U.getHeaderProps(U.getSortByToggleProps()),className:xe.th,children:[q("span",{children:U.render("Header")}),q("span",{className:xe.sortIconContainer,children:U.isSorted?q("span",{className:U.isSortedDesc?"":xe.rotate180,children:q(mo,{size:16})}):null})]})),O.map((U,de)=>(_(U),U.cells.map((u,X)=>q("div",{...u.getCellProps(),className:Ae(xe.td,de%2===0?xe.odd:!1,v.hasProcessPath?X>=2&&X<=5?xe.du:!1:X>=1&&X<=4?xe.du:!1),children:Zo(u)}))))]}))})}const ri="_overlay_148w6_1",oi="_cnt_148w6_5",ii="_afterOpen_148w6_15",ai="_btngrp_148w6_20",Ye={overlay:ri,cnt:oi,afterOpen:ii,btngrp:ai},{useRef:ui,useCallback:si,useMemo:li}=be;function ci({isOpen:b,onRequestClose:v,primaryButtonOnTap:f}){const g=ui(null),O=si(()=>{g.current.focus()},[]),_=li(()=>({base:Ae(gn.content,Ye.cnt),afterOpen:Ye.afterOpen,beforeClose:""}),[]);return ye(oo,{isOpen:b,onRequestClose:v,onAfterOpen:O,className:_,overlayClassName:Ae(gn.overlay,Ye.overlay),children:[q("p",{children:"Are you sure you want to close all connections?"}),ye("div",{className:Ye.btngrp,children:[q(vn,{onClick:f,ref:g,children:"I'm sure"}),q("div",{style:{width:20}}),q(vn,{onClick:v,children:"No"})]})]})}const{useEffect:di,useState:Me,useRef:fi,useCallback:je}=be,yn=30;function pi(b){const v={};for(let f=0;f<b.length;f++){const g=b[f];v[g.id]=g}return v}function gi(b){return b==null?void 0:b.replace(/.*[/\\]/,"")}function vi(b,v){return b.toLowerCase().includes(v.toLowerCase())}function wn(b,v){return v?b.filter(f=>[f.host,f.sourceIP,f.sourcePort,f.destinationIP,f.chains,f.rule,f.type,f.network,f.processPath].some(g=>vi(g,v))):b}function mi(b,v,f,g){const{id:O,metadata:_,upload:c,download:U,start:de,chains:u,rule:X,rulePayload:ee}=b,{host:le,destinationPort:fe,destinationIP:D,network:J,type:ce,sourceIP:Z,sourcePort:ie}=_,m=_.processPath;g.hasProcessPath===!1&&typeof m<"u"&&(g.hasProcessPath=!0);let G=le;G===""&&(G=D);const M=v[O];return{id:O,upload:c,download:U,start:f-new Date(de).valueOf(),chains:u.reverse().join(" / "),rule:ee?`${X}(${ee})`:X,..._,host:`${G}:${fe}`,type:`${ce}(${J})`,source:`${Z}:${ie}`,downloadSpeedCurr:U-(M?M.download:0),uploadSpeedCurr:c-(M?M.upload:0),process:gi(m)}}function bn(b){return b.length>0?q(ni,{data:b}):q("div",{className:Le.placeHolder,children:q(go,{width:200,height:200,c1:"var(--color-text)"})})}function Rn({qty:b}){return b<100?""+b:"99+"}function hi({apiConfig:b}){const[v,f]=vo(),[g,O]=Me([]),[_,c]=Me([]),[U,de]=Me(""),u=wn(g,U),X=wn(_,U),[ee,le]=Me(!1),fe=je(()=>le(!0),[]),D=je(()=>le(!1),[]),[J,ce]=Me(!1),Z=je(()=>{ce(ae=>!ae)},[]),ie=je(()=>{ao(b),D()},[b,D]),m=fi(g),G=be.useContext(Cn),M=je(({connections:ae})=>{const ve=pi(m.current),Be=Date.now(),me=ae.map(we=>mi(we,ve,Be,G)),Ce=[];for(const we of m.current)me.findIndex(ne=>ne.id===we.id)<0&&Ce.push(we);c(we=>[...Ce,...we].slice(0,101)),me&&(me.length!==0||m.current.length!==0)&&!J?(m.current=me,O(me)):m.current=me},[O,J]);di(()=>uo(b,M),[b,M]);const{t:K}=so();return ye("div",{children:[q(lo,{title:K("Connections")}),ye(nt,{children:[ye("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between"},children:[ye(rt,{children:[ye(De,{children:[q("span",{children:K("Active")}),q("span",{className:Le.connQty,children:Rn({qty:u.length})})]}),ye(De,{children:[q("span",{children:K("Closed")}),q("span",{className:Le.connQty,children:Rn({qty:X.length})})]})]}),q("div",{className:Le.inputWrapper,children:q("input",{type:"text",name:"filter",autoComplete:"off",className:Le.input,placeholder:"Filter",onChange:ae=>de(ae.target.value)})})]}),q("div",{ref:v,style:{padding:30,paddingBottom:yn,paddingTop:0},children:ye("div",{style:{height:f-yn,overflow:"auto"},children:[ye(Ve,{children:[q(co,{children:bn(u)}),q(yo,{icon:J?q(Ro,{size:16}):q(Co,{size:16}),mainButtonStyles:J?{background:"#e74c3c"}:{},style:wo,text:K(J?"Resume Refresh":"Pause Refresh"),onClick:Z,children:q(bo,{text:"Close All Connections",onClick:fe,children:q(fo,{size:10})})})]}),q(Ve,{children:bn(X)})]})}),q(ci,{isOpen:ee,primaryButtonOnTap:ie,onRequestClose:D})]})]})}const yi=b=>({apiConfig:po(b)}),xi=io(yi)(hi);export{xi as default};