mantine-datatable 2.4.0 → 2.4.2

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var la=Object.create;var Lo=Object.defineProperty;var da=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var ca=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty;var pa=(o,e)=>()=>(o&&(e=o(o=0)),e);var ne=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),ma=(o,e)=>{for(var r in e)Lo(o,r,{get:e[r],enumerable:!0})},Xe=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of sa(e))!ua.call(o,f)&&f!==r&&Lo(o,f,{get:()=>e[f],enumerable:!(t=da(e,f))||t.enumerable});return o};var Ze=(o,e,r)=>(r=o!=null?la(ca(o)):{},Xe(e||!o||!o.__esModule?Lo(r,"default",{value:o,enumerable:!0}):r,o)),xa=o=>Xe(Lo({},"__esModule",{value:!0}),o);var c,a=pa(()=>{"use strict";c=Ze(require("react"),1)});var $e=ne((Va,Ke)=>{"use strict";a();var ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ke.exports=ia});var Je=ne((Xa,je)=>{"use strict";a();var ga=$e();function Ye(){}function _e(){}_e.resetWarningCache=Ye;je.exports=function(){function o(t,f,n,d,u,p){if(p!==ga){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:_e,resetWarningCache:Ye};return r.PropTypes=r,r}});var er=ne(($a,or)=>{a();or.exports=Je()();var Qa,Ka});var Na={};ma(Na,{DataTable:()=>Re,differenceBy:()=>qo,getValueAtPath:()=>b,humanize:()=>no,uniqBy:()=>lo});module.exports=xa(Na);a();a();var K=require("@mantine/core"),oo=require("@mantine/hooks"),G=require("react");a();var Qe=require("@mantine/core"),le=require("react/jsx-runtime"),Ia=(0,Qe.createStyles)({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function de(){let{classes:o}=Ia();return(0,le.jsx)("tr",{className:o.root,children:(0,le.jsx)("td",{})})}a();var fo=require("@mantine/core");a();a();var Do=require("react"),Z=Ze(er());a();var rr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Ca=Object.defineProperty,Sa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,Ho=Object.getOwnPropertySymbols,fr=Object.prototype.hasOwnProperty,nr=Object.prototype.propertyIsEnumerable,ar=(o,e,r)=>e in o?Ca(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,tr=(o,e)=>{for(var r in e||(e={}))fr.call(e,r)&&ar(o,r,e[r]);if(Ho)for(var r of Ho(e))nr.call(e,r)&&ar(o,r,e[r]);return o},ba=(o,e)=>Sa(o,ha(e)),Ba=(o,e)=>{var r={};for(var t in o)fr.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Ho)for(var t of Ho(o))e.indexOf(t)<0&&nr.call(o,t)&&(r[t]=o[t]);return r},to=(o,e,r)=>{let t=(0,Do.forwardRef)((f,n)=>{var d=f,{color:u="currentColor",size:p=24,stroke:l=2,children:m}=d,i=Ba(d,["color","size","stroke","children"]);return(0,Do.createElement)("svg",tr(ba(tr({ref:n},rr),{width:p,height:p,stroke:u,strokeWidth:l,className:`tabler-icon tabler-icon-${o}`}),i),[...r.map(([I,s])=>(0,Do.createElement)(I,s)),...m||[]])});return t.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number]),stroke:Z.default.oneOfType([Z.default.string,Z.default.number])},t.displayName=`${e}`,t};a();var se=to("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var ce=to("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var ue=to("database-off","IconDatabaseOff",[["path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74",key:"svg-0"}],["path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);var W=require("react/jsx-runtime"),Da=(0,fo.createStyles)(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function pe({icon:o,text:e,pt:r,pb:t,active:f,children:n}){let{classes:d,cx:u}=Da();return(0,W.jsx)(fo.Center,{pt:r,pb:t,className:u(d.root,{[d.active]:f}),children:n||(0,W.jsxs)(W.Fragment,{children:[o||(0,W.jsx)("div",{className:d.standardIcon,children:(0,W.jsx)(ue,{})}),(0,W.jsx)(fo.Text,{size:"sm",color:"dimmed",children:e})]})})}a();var cr=require("@mantine/core"),ur=require("react");a();var F=require("@mantine/core");a();var lr=require("@mantine/core"),dr=require("@mantine/hooks"),Eo=require("react"),sr=typeof window<"u"?Eo.useLayoutEffect:Eo.useEffect;function No(o){let e=(0,lr.useMantineTheme)(),r=typeof o=="function"?o(e):o;return(0,dr.useMediaQuery)(r||"",!0)}function no(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function qo(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function lo(o,e){return o.filter((r,t,f)=>t===f.findIndex(n=>e(r)===e(n)))}function b(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}var L=require("react/jsx-runtime"),ya=(0,F.createStyles)(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function me({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:n,sortable:d,sortIcons:u,textAlignment:p,width:l,sortStatus:m,onSortStatusChange:i}){let{cx:I,classes:s}=ya();if(!No(f))return null;let C=n??no(t),g=typeof C=="string"?C:void 0,B=d&&i?()=>{i({columnAccessor:t,direction:m?.direction==="asc"?"desc":"asc"})}:void 0;return(0,L.jsx)(F.Box,{component:"th",className:I({[s.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:p},width:l,minWidth:l,maxWidth:l},e],style:r,role:d?"button":void 0,tabIndex:d?0:void 0,onClick:B,onKeyDown:S=>S.key==="Enter"&&B?.(),children:d||m?.columnAccessor===t?(0,L.jsxs)(F.Group,{className:s.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[(0,L.jsx)(F.Box,{className:I(s.columnHeaderText,s.sortableColumnHeaderText),title:g,children:C}),m?.columnAccessor===t?(0,L.jsx)(F.Center,{className:I(s.sortableColumnHeaderIcon,{[s.sortableColumnHeaderIconRotated]:m.direction==="desc"}),"aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||(0,L.jsx)(se,{size:14})}):(0,L.jsx)(F.Center,{className:s.sortableColumnHeaderUnsortedIcon,children:u?.unsorted||(0,L.jsx)(ce,{size:14})})]}):(0,L.jsx)(F.Box,{className:s.columnHeaderText,title:g,children:C})})}a();var so=require("@mantine/core"),xe=require("react/jsx-runtime"),Ta=(0,so.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-(0,so.px)(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function Ie({shadowVisible:o,checked:e,indeterminate:r,onChange:t}){let{cx:f,classes:n}=Ta();return(0,xe.jsx)("th",{className:f(n.root,{[n.shadowVisible]:o}),children:(0,xe.jsx)(so.Checkbox,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!t,onChange:t})})}var co=require("react/jsx-runtime"),wa=(0,cr.createStyles)(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),pr=(0,ur.forwardRef)(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:n,columns:d,selectionVisible:u,selectionChecked:p,selectionIndeterminate:l,onSelectionChange:m,leftShadowVisible:i},I){let{classes:s,cx:C}=wa();return(0,co.jsx)("thead",{className:C(s.root,e),style:r,ref:I,children:(0,co.jsxs)("tr",{children:[u&&(0,co.jsx)(Ie,{shadowVisible:i,checked:p,indeterminate:l,onChange:m}),d.map(({accessor:g,hidden:B,visibleMediaQuery:S,textAlignment:$,width:q,title:R,sortable:P,titleClassName:T,titleStyle:k,titleSx:v})=>B?null:(0,co.jsx)(me,{className:T,style:k,sx:v,accessor:g,visibleMediaQuery:S,textAlignment:$,width:q,title:R,sortable:P,sortStatus:t,sortIcons:f,onSortStatusChange:n},g))]})})});a();var uo=require("@mantine/core"),ie=require("react/jsx-runtime"),Pa=(0,uo.createStyles)(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function ge({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:n,variant:d,color:u}){let{classes:p,cx:l}=Pa();return(0,ie.jsx)(uo.Center,{pt:o,pb:e,className:l(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||(0,ie.jsx)(uo.Loader,{size:n,variant:d,color:u}))})}a();var Q=require("@mantine/core"),xr=require("react");a();var O=require("@mantine/core"),H=require("react/jsx-runtime"),mr={xs:22,sm:26,md:32,lg:38,xl:44};function Ce({size:o,label:e,values:r,value:t,onChange:f,color:n}){return(0,H.jsxs)(O.Group,{spacing:"xs",children:[(0,H.jsx)(O.Text,{size:o,children:e}),(0,H.jsxs)(O.Menu,{withinPortal:!0,withArrow:!0,children:[(0,H.jsx)(O.Menu.Target,{children:(0,H.jsx)(O.Button,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:mr[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),(0,H.jsx)(O.Menu.Dropdown,{children:r.map(d=>{let u=d===t;return(0,H.jsx)(O.Menu.Item,{sx:[{height:mr[o]},p=>({"&&":{color:u?p.white:void 0},background:u?p.colors[n||p.primaryColor][6]:void 0})],disabled:u,onClick:()=>f(d),children:(0,H.jsx)(O.Text,{size:o,children:d})},d)})})]})]})}var po=require("react/jsx-runtime"),Ma=(0,Q.createStyles)((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),Ir=(0,xr.forwardRef)(function({className:e,style:r,topBorderColor:t,fetching:f,page:n,onPageChange:d,paginationColor:u,paginationSize:p,loadingText:l,noRecordsText:m,paginationText:i,totalRecords:I,recordsPerPage:s,onRecordsPerPageChange:C,recordsPerPageLabel:g,recordsPerPageOptions:B,recordsLength:S,horizontalSpacing:$,paginationWrapBreakpoint:q},R){let P;if(f)P=l;else if(!I)P=m;else{let v=(n-1)*s+1,io=v+S-1;P=i({from:v,to:io,totalRecords:I})}let{classes:T,cx:k}=Ma({topBorderColor:t,paginationWrapBreakpoint:q});return(0,po.jsxs)(Q.Box,{ref:R,px:$??"xs",py:"xs",className:k(T.root,e),style:r,children:[(0,po.jsx)(Q.Text,{className:T.text,size:p,children:P}),B&&(0,po.jsx)(Ce,{size:p,label:g,values:B,value:s,onChange:C}),(0,po.jsx)(Q.Pagination,{color:u,className:k(T.pagination,{[T.paginationFetching]:f||!S}),value:n,onChange:d,size:p,total:Math.ceil(I/s)})]})});a();var zo=require("@mantine/core");a();var Wo=require("@mantine/core");var ir=require("react/jsx-runtime"),Ra=(0,Wo.createStyles)({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Se({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:n,onClick:d,noWrap:u,ellipsis:p,textAlignment:l,width:m,accessor:i,render:I,defaultRender:s,customCellAttributes:C}){let{cx:g,classes:B}=Ra();return No(t)?(0,ir.jsx)(Wo.Box,{component:"td",className:g({[B.noWrap]:u||p,[B.ellipsis]:p,[B.withPointerCursor]:d},o),sx:[{width:m,minWidth:m,maxWidth:m,textAlign:l},e],style:r,onClick:d,...C?.(f,n),children:I?I(f,n):s?s(f,n,i):b(f,i)}):null}a();var Uo=require("@mantine/core");a();var he=require("@mantine/hooks"),E=require("react");function gr(o){let[e,r]=(0,E.useState)(null),t=o?.join(":")||"";return(0,E.useEffect)(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Cr(o){let[e,r]=(0,E.useState)(null);return(0,E.useEffect)(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function Sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:u,allowMultiple:p,initiallyExpanded:l}=o;e&&u==="always"?t=e.map(m=>b(m,r)):l&&(t=e.filter(l).map(m=>b(m,r)),p||(t=[t[0]]))}let f,n,d=(0,E.useState)(t);if(o){let{trigger:u,allowMultiple:p,collapseProps:l,content:m}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=d;let i=I=>n(f.filter(s=>s!==b(I,r)));return{expandOnClick:u!=="always"&&u!=="never",isRowExpanded:I=>u==="always"?!0:f.includes(b(I,r)),expandRow:I=>{let s=b(I,r);n(p?[...f,s]:[s])},collapseRow:i,collapseProps:l,content:(I,s)=>()=>m({record:I,recordIndex:s,collapse:()=>i(I)})}}}function hr(o,e){let[r,t]=(0,E.useState)(o),[f,n]=(0,E.useState)(o),d=(0,he.useTimeout)(()=>t(!0),0),u=(0,he.useTimeout)(()=>n(!1),e||200);return(0,E.useEffect)(()=>{o?(u.clear(),n(!0),d.start()):(d.clear(),t(!1),u.start())},[d,u,o]),{expanded:r,visible:f}}var U=require("react/jsx-runtime"),Oa=(0,Uo.createStyles)({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function be({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:n}=hr(o,t?.transitionDuration),{cx:d,classes:u}=Oa();return n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("tr",{}),(0,U.jsx)("tr",{children:(0,U.jsx)("td",{className:d(u.cell,{[u.expandedCell]:f}),colSpan:e,children:(0,U.jsx)(Uo.Collapse,{in:f,...t,children:r()})})})]}):null}a();var mo=require("@mantine/core"),Be=require("react/jsx-runtime"),ka=(0,mo.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-(0,mo.px)(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function De({withRightShadow:o,...e}){let{cx:r,classes:t}=ka();return(0,Be.jsx)("td",{className:r(t.root,{[t.withRightShadow]:o}),onClick:f=>f.stopPropagation(),children:(0,Be.jsx)(mo.Checkbox,{classNames:{input:t.checkbox},...e})})}var z=require("react/jsx-runtime"),Fa=(0,zo.createStyles)(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function ye({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:n,onSelectionChange:d,isRecordSelectable:u,onClick:p,onCellClick:l,onContextMenu:m,expansion:i,customRowAttributes:I,className:s,style:C,sx:g,contextMenuVisible:B,leftShadowVisible:S}){let{cx:$,classes:q}=Fa();return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(zo.Box,{component:"tr",className:$({[q.withPointerCursor]:p||i?.expandOnClick,[q.selected]:n,[q.contextMenuVisible]:B},typeof s=="function"?s(o,e):s),onClick:R=>{if(i){let{isRowExpanded:P,expandOnClick:T,expandRow:k,collapseRow:v}=i;T&&(P(o)?v(o):k(o))}p?.(R)},style:typeof C=="function"?C(o,e):C,sx:g,...I?.(o,e),onContextMenu:m,children:[f&&(0,z.jsx)(De,{withRightShadow:S,checked:n,disabled:!d||(u?!u(o,e):!1),onChange:d}),r.map((R,P)=>{let{accessor:T,hidden:k,visibleMediaQuery:v,textAlignment:io,noWrap:Vo,ellipsis:Go,width:Xo,render:Zo,cellsClassName:go,cellsStyle:Co,cellsSx:Qo,customCellAttributes:Ko}=R,To;return l&&(To=()=>l({record:o,recordIndex:e,column:R,columnIndex:P})),k?null:(0,z.jsx)(Se,{className:typeof go=="function"?go(o,e):go,style:typeof Co=="function"?Co(o,e):Co,sx:Qo,visibleMediaQuery:v,record:o,recordIndex:e,onClick:To,accessor:T,textAlignment:io,noWrap:Vo,ellipsis:Go,width:Xo,render:Zo,defaultRender:t,customCellAttributes:Ko},T)})]}),i&&(0,z.jsx)(be,{colSpan:r.filter(R=>!R.hidden).length+(f?1:0),open:i.isRowExpanded(o),content:i.content(o,e),collapseProps:i.collapseProps})]})}a();var xo=require("@mantine/core"),V=require("@mantine/hooks"),br=require("react/jsx-runtime"),va=(0,xo.createStyles)(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function Te({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:n,children:d}){(0,V.useWindowEvent)("resize",n),(0,V.useWindowEvent)("scroll",n);let u=(0,V.useClickOutside)(n),{ref:p,width:l,height:m}=(0,V.useElementSize)(),i=(0,V.useMergedRef)(u,p),{innerWidth:I,innerHeight:s}=window,{classes:C,theme:{dir:g,spacing:B}}=va(),S=(0,xo.px)(B.md);return(0,br.jsx)(xo.Paper,{ref:i,shadow:e,radius:o,className:C.root,sx:{zIndex:r,top:t+m+S>s?s-m-S:t,left:g==="ltr"?f+l+S>I?I-l-S:f:I-S-(f-l-S<0?l+S:f)},children:d})}a();var Br=require("@mantine/core"),Dr=require("react/jsx-runtime"),Aa=(0,Br.createStyles)(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function we(){let{classes:o}=Aa();return(0,Dr.jsx)("div",{className:o.root})}a();var N=require("@mantine/core"),yo=require("react/jsx-runtime"),La=(0,N.createStyles)((o,{color:e})=>{let r=(0,N.px)(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function Pe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:n}=La({color:r});return(0,yo.jsxs)(N.UnstyledButton,{className:n.root,disabled:t,onClick:f,children:[o&&(0,yo.jsx)(N.Box,{className:n.icon,children:o}),(0,yo.jsx)(N.Text,{className:n.title,size:"sm",children:e})]})}a();var Io=require("@mantine/core"),J=require("react/jsx-runtime"),Ha=(0,Io.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,top:0,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,bottom:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function Me({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:n,children:d,viewportRef:u}){let{cx:p,classes:l}=Ha();return(0,J.jsxs)(Io.ScrollArea,{viewportRef:u,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:n,children:[d,(0,J.jsx)(Io.Box,{className:p(l.shadow,l.topShadow,{[l.shadowVisible]:o}),sx:{top:f}}),(0,J.jsx)("div",{className:p(l.shadow,l.leftShadow,{[l.shadowVisible]:e})}),(0,J.jsx)("div",{className:p(l.shadow,l.rightShadow,{[l.shadowVisible]:r})}),(0,J.jsx)("div",{className:p(l.shadow,l.bottomShadow,{[l.shadowVisible]:t})})]})}var y=require("react/jsx-runtime"),yr={},Ea=(0,K.createStyles)((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Re({withBorder:o,borderRadius:e,borderColor:r=D=>D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],rowBorderColor:t=D=>D.fn.rgba(D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:d="100%",minHeight:u,shadow:p,verticalAlignment:l="center",fetching:m,columns:i,defaultColumnRender:I,idAccessor:s="id",records:C,selectedRecords:g,onSelectedRecordsChange:B,isRecordSelectable:S,sortStatus:$,sortIcons:q,onSortStatusChange:R,horizontalSpacing:P,page:T,onPageChange:k,totalRecords:v,recordsPerPage:io,onRecordsPerPageChange:Vo,recordsPerPageOptions:Go,recordsPerPageLabel:Xo="Records per page",paginationColor:Zo,paginationSize:go="sm",paginationText:Co=({from:D,to:So,totalRecords:eo})=>`${D} - ${So} / ${eo}`,paginationWrapBreakpoint:Qo="sm",loaderBackgroundBlur:Ko,customLoader:To,loaderSize:Tr,loaderVariant:wr,loaderColor:Pr,loadingText:Mr="...",emptyState:Rr,noRecordsText:Oe="No records",noRecordsIcon:Or,striped:kr,onRowClick:$o,onCellClick:Fr,onScrollToTop:ke,onScrollToBottom:Fe,onScrollToLeft:ve,onScrollToRight:Ae,rowContextMenu:A,rowExpansion:vr,rowClassName:Ar,rowStyle:Lr,rowSx:Hr,customRowAttributes:Er,scrollViewportRef:Nr,bodyRef:qr,m:Wr,my:Ur,mx:zr,mt:Vr,mb:Gr,ml:Xr,mr:Zr,sx:Qr,className:Kr,classNames:Yo,style:$r,styles:_o,...Yr}){let{ref:D,width:So,height:eo}=(0,oo.useElementSize)(),{ref:_r,height:jo}=(0,oo.useElementSize)(),{ref:jr,width:Jo,height:wo}=(0,oo.useElementSize)(),{ref:Jr,height:Le}=(0,oo.useElementSize)(),[oe,He]=(0,G.useState)(!0),[ee,Ee]=(0,G.useState)(!0),[Po,Ne]=(0,G.useState)(!0),[re,qe]=(0,G.useState)(!0),{rowContextMenuInfo:Y,setRowContextMenuInfo:ro}=Cr(m),oa=Sr({rowExpansion:vr,records:C,idAccessor:s}),ae=(0,G.useCallback)(()=>{if(!m&&A&&ro(null),m||wo<=eo)He(!0),Ee(!0);else{let x=D.current.scrollTop,h=x===0,w=wo-x-eo<1;He(h),Ee(w),h&&h!==oe&&ke?.(),w&&w!==ee&&Fe?.()}if(m||Jo===So)Ne(!0),qe(!0);else{let x=D.current.scrollLeft,h=x===0,w=Jo-x-So<1;Ne(h),qe(w),h&&h!==Po&&ve?.(),w&&w!==re&&Ae?.()}},[m,Fe,ve,Ae,ke,A,eo,D,So,ee,Po,re,oe,ro,wo,Jo]);sr(ae,[ae]);let ea=(0,G.useCallback)(x=>{D.current.scrollTo({top:0,left:0}),k(x)},[k,D]),Mo=C?.length,We=C?.map(x=>b(x,s)),ho=g?.map(x=>b(x,s)),Ue=We!==void 0&&ho!==void 0&&ho.length>0,te=S?C?.filter(S):C,Ro=te?.map(x=>b(x,s)),Oo=Ue&&Ro.every(x=>ho.includes(x)),ra=Ue&&Ro.some(x=>ho.includes(x)),aa=(0,G.useCallback)(()=>{B?.(Oo?g.filter(x=>!Ro.includes(b(x,s))):lo([...g,...te],x=>b(x,s)))},[Oo,s,B,Ro,te,g]),{lastSelectionChangeIndex:ko,setLastSelectionChangeIndex:ta}=gr(We),ze=!!g&&!Po,{cx:Ve,classes:X,theme:fa}=Ea({borderColor:r,rowBorderColor:t}),na={m:Wr,my:Ur,mx:zr,mt:Vr,mb:Gr,ml:Xr,mr:Zr},fe=typeof _o=="function"?_o(fa,yr,yr):_o;return(0,y.jsxs)(K.Box,{...na,className:Ve(X.root,{[X.tableWithBorder]:o},Kr,Yo?.root),sx:[x=>({borderRadius:x.radius[e]||e,boxShadow:x.shadows[p]||p,height:d,minHeight:u}),...(0,K.packSx)(Qr)],style:{...fe?.root,...$r},children:[(0,y.jsx)(Me,{viewportRef:(0,oo.useMergedRef)(D,Nr||null),topShadowVisible:!oe,leftShadowVisible:!(g||Po),rightShadowVisible:!re,bottomShadowVisible:!ee,headerHeight:jo,onScrollPositionChange:ae,children:(0,y.jsxs)(K.Table,{ref:jr,horizontalSpacing:P,className:Ve(X.table,{[X.tableWithColumnBorders]:f,[X.lastRowBorderBottomVisible]:wo<eo,[X.textSelectionDisabled]:n,[X.verticalAlignmentTop]:l==="top",[X.verticalAlignmentBottom]:l==="bottom"}),striped:Mo?kr:!1,...Yr,children:[(0,y.jsx)(pr,{ref:_r,className:Yo?.header,style:fe?.header,columns:i,sortStatus:$,sortIcons:q,onSortStatusChange:R,selectionVisible:!!g,selectionChecked:Oo,selectionIndeterminate:ra&&!Oo,onSelectionChange:aa,leftShadowVisible:ze}),(0,y.jsx)("tbody",{ref:qr,children:Mo?C.map((x,h)=>{let w=b(x,s),bo=ho?.includes(w)||!1,Fo=!1,vo=!1;if(A){let{hidden:M}=A;(!M||!(typeof M=="function"?M(x,h):M))&&(A.trigger==="click"?Fo=!0:vo=!0)}let Ao;B&&(Ao=M=>{if(M.nativeEvent.shiftKey&&ko!==null){let ao=C.filter(h>ko?(_,j)=>j>=ko&&j<=h&&(S?S(_,j):!0):(_,j)=>j>=h&&j<=ko&&(S?S(_,j):!0));B(bo?qo(g,ao,_=>b(_,s)):lo([...g,...ao],_=>b(_,s)))}else B(bo?g.filter(ao=>b(ao,s)!==w):lo([...g,x],ao=>b(ao,s)));ta(h)});let Bo;Fo?Bo=M=>{ro({y:M.clientY,x:M.clientX,record:x,recordIndex:h}),$o?.(x,h)}:$o&&(Bo=()=>{$o(x,h)});let Ge;return vo&&(Ge=M=>{M.preventDefault(),ro({y:M.clientY,x:M.clientX,record:x,recordIndex:h})}),(0,y.jsx)(ye,{record:x,recordIndex:h,columns:i,defaultColumnRender:I,selectionVisible:!!g,selectionChecked:bo,onSelectionChange:Ao,isRecordSelectable:S,onClick:Bo,onCellClick:Fr,onContextMenu:Ge,contextMenuVisible:Y?b(Y.record,s)===w:!1,expansion:oa,className:Ar,style:Lr,sx:Hr,customRowAttributes:Er,leftShadowVisible:ze},w)}):(0,y.jsx)(de,{})})]})}),T&&(0,y.jsx)(Ir,{ref:Jr,className:Yo?.pagination,style:fe?.pagination,topBorderColor:r,horizontalSpacing:P,fetching:m,page:T,onPageChange:ea,totalRecords:v,recordsPerPage:io,onRecordsPerPageChange:Vo,recordsPerPageOptions:Go,recordsPerPageLabel:Xo,paginationColor:Zo,paginationSize:go,paginationText:Co,paginationWrapBreakpoint:Qo,noRecordsText:Oe,loadingText:Mr,recordsLength:Mo}),(0,y.jsx)(ge,{pt:jo,pb:Le,fetching:m,backgroundBlur:Ko,customContent:To,size:Tr,variant:wr,color:Pr}),(0,y.jsx)(pe,{pt:jo,pb:Le,icon:Or,text:Oe,active:!m&&!Mo,children:Rr}),A&&Y&&(0,y.jsx)(Te,{zIndex:A.zIndex,borderRadius:A.borderRadius,shadow:A.shadow,y:Y.y,x:Y.x,onDestroy:()=>ro(null),children:A.items(Y.record,Y.recordIndex).map(({divider:x,key:h,title:w,icon:bo,color:Fo,hidden:vo,disabled:Ao,onClick:Bo})=>x?(0,y.jsx)(we,{},h):vo?null:(0,y.jsx)(Pe,{title:w??no(h),icon:bo,color:Fo,disabled:Ao,onClick:()=>{ro(null),Bo()}},h))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();
1
+ "use strict";var la=Object.create;var Lo=Object.defineProperty;var da=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var ca=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty;var pa=(o,e)=>()=>(o&&(e=o(o=0)),e);var le=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),ma=(o,e)=>{for(var r in e)Lo(o,r,{get:e[r],enumerable:!0})},Ze=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of sa(e))!ua.call(o,f)&&f!==r&&Lo(o,f,{get:()=>e[f],enumerable:!(t=da(e,f))||t.enumerable});return o};var Qe=(o,e,r)=>(r=o!=null?la(ca(o)):{},Ze(e||!o||!o.__esModule?Lo(r,"default",{value:o,enumerable:!0}):r,o)),xa=o=>Ze(Lo({},"__esModule",{value:!0}),o);var c,a=pa(()=>{"use strict";c=Qe(require("react"),1)});var Ye=le((Va,$e)=>{"use strict";a();var ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";$e.exports=ia});var or=le((Xa,Je)=>{"use strict";a();var ga=Ye();function _e(){}function je(){}je.resetWarningCache=_e;Je.exports=function(){function o(t,f,n,d,u,p){if(p!==ga){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}o.isRequired=o;function e(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:e,element:o,elementType:o,instanceOf:e,node:o,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:je,resetWarningCache:_e};return r.PropTypes=r,r}});var rr=le(($a,er)=>{a();er.exports=or()();var Qa,Ka});var Na={};ma(Na,{DataTable:()=>Oe,differenceBy:()=>qo,getValueAtPath:()=>b,humanize:()=>no,uniqBy:()=>lo});module.exports=xa(Na);a();a();var K=require("@mantine/core"),oo=require("@mantine/hooks"),G=require("react");a();var Ke=require("@mantine/core"),de=require("react/jsx-runtime"),Ia=(0,Ke.createStyles)({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function se(){let{classes:o}=Ia();return(0,de.jsx)("tr",{className:o.root,children:(0,de.jsx)("td",{})})}a();var fo=require("@mantine/core");a();a();var Do=require("react"),Z=Qe(rr());a();var ar={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Ca=Object.defineProperty,Sa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,Ho=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,tr=(o,e,r)=>e in o?Ca(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,fr=(o,e)=>{for(var r in e||(e={}))nr.call(e,r)&&tr(o,r,e[r]);if(Ho)for(var r of Ho(e))lr.call(e,r)&&tr(o,r,e[r]);return o},ba=(o,e)=>Sa(o,ha(e)),Ba=(o,e)=>{var r={};for(var t in o)nr.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&Ho)for(var t of Ho(o))e.indexOf(t)<0&&lr.call(o,t)&&(r[t]=o[t]);return r},to=(o,e,r)=>{let t=(0,Do.forwardRef)((f,n)=>{var d=f,{color:u="currentColor",size:p=24,stroke:l=2,children:m}=d,i=Ba(d,["color","size","stroke","children"]);return(0,Do.createElement)("svg",fr(ba(fr({ref:n},ar),{width:p,height:p,stroke:u,strokeWidth:l,className:`tabler-icon tabler-icon-${o}`}),i),[...r.map(([I,s])=>(0,Do.createElement)(I,s)),...m||[]])});return t.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number]),stroke:Z.default.oneOfType([Z.default.string,Z.default.number])},t.displayName=`${e}`,t};a();var ce=to("arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);a();var ue=to("arrows-vertical","IconArrowsVertical",[["path",{d:"M8 7l4 -4l4 4",key:"svg-0"}],["path",{d:"M8 17l4 4l4 -4",key:"svg-1"}],["path",{d:"M12 3l0 18",key:"svg-2"}]]);a();var pe=to("database-off","IconDatabaseOff",[["path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74",key:"svg-0"}],["path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6",key:"svg-1"}],["path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]]);var W=require("react/jsx-runtime"),Da=(0,fo.createStyles)(o=>({root:{position:"absolute",top:0,right:0,bottom:0,left:0,flexDirection:"column",pointerEvents:"none",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[6],opacity:0,transition:"opacity .15s ease"},active:{opacity:1},standardIcon:{fontSize:0,borderRadius:"50%",padding:o.spacing.xs,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[2]}}));function me({icon:o,text:e,pt:r,pb:t,active:f,children:n}){let{classes:d,cx:u}=Da();return(0,W.jsx)(fo.Center,{pt:r,pb:t,className:u(d.root,{[d.active]:f}),children:n||(0,W.jsxs)(W.Fragment,{children:[o||(0,W.jsx)("div",{className:d.standardIcon,children:(0,W.jsx)(pe,{})}),(0,W.jsx)(fo.Text,{size:"sm",color:"dimmed",children:e})]})})}a();var ur=require("@mantine/core"),pr=require("react");a();var F=require("@mantine/core");a();var dr=require("@mantine/core"),sr=require("@mantine/hooks"),Eo=require("react"),cr=typeof window<"u"?Eo.useLayoutEffect:Eo.useEffect;function No(o){let e=(0,dr.useMantineTheme)(),r=typeof o=="function"?o(e):o;return(0,sr.useMediaQuery)(r||"",!0)}function no(o){let e=o.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function qo(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function lo(o,e){return o.filter((r,t,f)=>t===f.findIndex(n=>e(r)===e(n)))}function b(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}var L=require("react/jsx-runtime"),ya=(0,F.createStyles)(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover":{background:o.colorScheme==="dark"?o.colors.dark[6]:o.colors.gray[0]}},sortableColumnHeaderGroup:{gap:"0.25em"},columnHeaderText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},sortableColumnHeaderText:{minWidth:0,flexGrow:1},sortableColumnHeaderIcon:{transition:"transform .15s ease"},sortableColumnHeaderIconRotated:{transform:"rotate3d(0, 0, 1, 180deg)"},sortableColumnHeaderUnsortedIcon:{color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5],transition:"color .15s ease","th:hover &":{color:o.colorScheme==="dark"?o.colors.dark[2]:o.colors.gray[6]}}}));function xe({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:n,sortable:d,sortIcons:u,textAlignment:p,width:l,sortStatus:m,onSortStatusChange:i}){let{cx:I,classes:s}=ya();if(!No(f))return null;let C=n??no(t),g=typeof C=="string"?C:void 0,B=d&&i?()=>{i({columnAccessor:t,direction:m?.direction==="asc"?"desc":"asc"})}:void 0;return(0,L.jsx)(F.Box,{component:"th",className:I({[s.sortableColumnHeader]:d},o),sx:[{"&&":{textAlign:p},width:l,minWidth:l,maxWidth:l},e],style:r,role:d?"button":void 0,tabIndex:d?0:void 0,onClick:B,onKeyDown:S=>S.key==="Enter"&&B?.(),children:d||m?.columnAccessor===t?(0,L.jsxs)(F.Group,{className:s.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[(0,L.jsx)(F.Box,{className:I(s.columnHeaderText,s.sortableColumnHeaderText),title:g,children:C}),m?.columnAccessor===t?(0,L.jsx)(F.Center,{className:I(s.sortableColumnHeaderIcon,{[s.sortableColumnHeaderIconRotated]:m.direction==="desc"}),"aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:u?.sorted||(0,L.jsx)(ce,{size:14})}):(0,L.jsx)(F.Center,{className:s.sortableColumnHeaderUnsortedIcon,children:u?.unsorted||(0,L.jsx)(ue,{size:14})})]}):(0,L.jsx)(F.Box,{className:s.columnHeaderText,title:g,children:C})})}a();var so=require("@mantine/core"),Ie=require("react/jsx-runtime"),Ta=(0,so.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",width:0,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-(0,so.px)(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},shadowVisible:{"&::after":{opacity:1}},checkboxInput:{cursor:"pointer"}}});function ie({shadowVisible:o,checked:e,indeterminate:r,onChange:t}){let{cx:f,classes:n}=Ta();return(0,Ie.jsx)("th",{className:f(n.root,{[n.shadowVisible]:o}),children:(0,Ie.jsx)(so.Checkbox,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!t,onChange:t})})}var co=require("react/jsx-runtime"),wa=(0,ur.createStyles)(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),mr=(0,pr.forwardRef)(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:n,columns:d,selectionVisible:u,selectionChecked:p,selectionIndeterminate:l,onSelectionChange:m,leftShadowVisible:i},I){let{classes:s,cx:C}=wa();return(0,co.jsx)("thead",{className:C(s.root,e),style:r,ref:I,children:(0,co.jsxs)("tr",{children:[u&&(0,co.jsx)(ie,{shadowVisible:i,checked:p,indeterminate:l,onChange:m}),d.map(({accessor:g,hidden:B,visibleMediaQuery:S,textAlignment:$,width:q,title:R,sortable:M,titleClassName:w,titleStyle:k,titleSx:v})=>B?null:(0,co.jsx)(xe,{className:w,style:k,sx:v,accessor:g,visibleMediaQuery:S,textAlignment:$,width:q,title:R,sortable:M,sortStatus:t,sortIcons:f,onSortStatusChange:n},g))]})})});a();var uo=require("@mantine/core"),ge=require("react/jsx-runtime"),Pa=(0,uo.createStyles)(o=>({root:{zIndex:3,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",background:o.fn.rgba(o.colorScheme==="dark"?o.colors.dark[8]:o.white,.75),opacity:0,transition:"opacity .15s ease"},fetching:{pointerEvents:"all",opacity:1}}));function Ce({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:n,variant:d,color:u}){let{classes:p,cx:l}=Pa();return(0,ge.jsx)(uo.Center,{pt:o,pb:e,className:l(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||(0,ge.jsx)(uo.Loader,{size:n,variant:d,color:u}))})}a();var Q=require("@mantine/core"),Ir=require("react");a();var O=require("@mantine/core"),H=require("react/jsx-runtime"),xr={xs:22,sm:26,md:32,lg:38,xl:44};function Se({size:o,label:e,values:r,value:t,onChange:f,color:n}){return(0,H.jsxs)(O.Group,{spacing:"xs",children:[(0,H.jsx)(O.Text,{size:o,children:e}),(0,H.jsxs)(O.Menu,{withinPortal:!0,withArrow:!0,children:[(0,H.jsx)(O.Menu.Target,{children:(0,H.jsx)(O.Button,{size:o,variant:"default",sx:[{fontWeight:"normal"},d=>({height:xr[o],paddingLeft:d.spacing[o],paddingRight:d.spacing[o]})],children:t})}),(0,H.jsx)(O.Menu.Dropdown,{children:r.map(d=>{let u=d===t;return(0,H.jsx)(O.Menu.Item,{sx:[{height:xr[o]},p=>({"&&":{color:u?p.white:void 0},background:u?p.colors[n||p.primaryColor][6]:void 0})],disabled:u,onClick:()=>f(d),children:(0,H.jsx)(O.Text,{size:o,children:d})},d)})})]})]})}var po=require("react/jsx-runtime"),Ma=(0,Q.createStyles)((o,{topBorderColor:e,paginationWrapBreakpoint:r})=>({root:{background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,borderTop:`1px solid ${typeof e=="function"?e(o):e}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:o.spacing.xs,[o.fn.largerThan(r)]:{flexDirection:"row"}},text:{flex:"1 1 auto"},pagination:{opacity:1,transition:"opacity .15s ease"},paginationFetching:{opacity:0}})),ir=(0,Ir.forwardRef)(function({className:e,style:r,topBorderColor:t,fetching:f,page:n,onPageChange:d,paginationColor:u,paginationSize:p,loadingText:l,noRecordsText:m,paginationText:i,totalRecords:I,recordsPerPage:s,onRecordsPerPageChange:C,recordsPerPageLabel:g,recordsPerPageOptions:B,recordsLength:S,horizontalSpacing:$,paginationWrapBreakpoint:q},R){let M;if(f)M=l;else if(!I)M=m;else{let v=(n-1)*s+1,io=v+S-1;M=i({from:v,to:io,totalRecords:I})}let{classes:w,cx:k}=Ma({topBorderColor:t,paginationWrapBreakpoint:q});return(0,po.jsxs)(Q.Box,{ref:R,px:$??"xs",py:"xs",className:k(w.root,e),style:r,children:[(0,po.jsx)(Q.Text,{className:w.text,size:p,children:M}),B&&(0,po.jsx)(Se,{size:p,label:g,values:B,value:s,onChange:C}),(0,po.jsx)(Q.Pagination,{color:u,className:k(w.pagination,{[w.paginationFetching]:f||!S}),value:n,onChange:d,size:p,total:Math.ceil(I/s)})]})});a();var zo=require("@mantine/core");a();var Wo=require("@mantine/core");var gr=require("react/jsx-runtime"),Ra=(0,Wo.createStyles)({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function he({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:n,onClick:d,noWrap:u,ellipsis:p,textAlignment:l,width:m,accessor:i,render:I,defaultRender:s,customCellAttributes:C}){let{cx:g,classes:B}=Ra();return No(t)?(0,gr.jsx)(Wo.Box,{component:"td",className:g({[B.noWrap]:u||p,[B.ellipsis]:p,[B.withPointerCursor]:d},o),sx:[{width:m,minWidth:m,maxWidth:m,textAlign:l},e],style:r,onClick:d,...C?.(f,n),children:I?I(f,n):s?s(f,n,i):b(f,i)}):null}a();var Uo=require("@mantine/core");a();var be=require("@mantine/hooks"),E=require("react");function Cr(o){let[e,r]=(0,E.useState)(null),t=o?.join(":")||"";return(0,E.useEffect)(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Sr(o){let[e,r]=(0,E.useState)(null);return(0,E.useEffect)(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function hr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:u,allowMultiple:p,initiallyExpanded:l}=o;e&&u==="always"?t=e.map(m=>b(m,r)):l&&(t=e.filter(l).map(m=>b(m,r)),p||(t=[t[0]]))}let f,n,d=(0,E.useState)(t);if(o){let{trigger:u,allowMultiple:p,collapseProps:l,content:m}=o;o.expanded?{recordIds:f,onRecordIdsChange:n}=o.expanded:[f,n]=d;let i=I=>n(f.filter(s=>s!==b(I,r)));return{expandOnClick:u!=="always"&&u!=="never",isRowExpanded:I=>u==="always"?!0:f.includes(b(I,r)),expandRow:I=>{let s=b(I,r);n(p?[...f,s]:[s])},collapseRow:i,collapseProps:l,content:(I,s)=>()=>m({record:I,recordIndex:s,collapse:()=>i(I)})}}}function br(o,e){let[r,t]=(0,E.useState)(o),[f,n]=(0,E.useState)(o),d=(0,be.useTimeout)(()=>t(!0),0),u=(0,be.useTimeout)(()=>n(!1),e||200);return(0,E.useEffect)(()=>{o?(u.clear(),n(!0),d.start()):(d.clear(),t(!1),u.start())},[d,u,o]),{expanded:r,visible:f}}var U=require("react/jsx-runtime"),Oa=(0,Uo.createStyles)({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function Be({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:n}=br(o,t?.transitionDuration),{cx:d,classes:u}=Oa();return n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("tr",{}),(0,U.jsx)("tr",{children:(0,U.jsx)("td",{className:d(u.cell,{[u.expandedCell]:f}),colSpan:e,children:(0,U.jsx)(Uo.Collapse,{in:f,...t,children:r()})})})]}):null}a();var mo=require("@mantine/core"),De=require("react/jsx-runtime"),ka=(0,mo.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{position:"sticky",zIndex:1,left:0,background:"inherit","&::after":{content:'""',position:"absolute",top:0,right:-(0,mo.px)(o.spacing.sm),bottom:0,borderLeft:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`,pointerEvents:"none",opacity:0,transition:"opacity .15s ease"}},withRightShadow:{"&::after":{opacity:1}},checkbox:{cursor:"pointer"}}});function ye({withRightShadow:o,...e}){let{cx:r,classes:t}=ka();return(0,De.jsx)("td",{className:r(t.root,{[t.withRightShadow]:o}),onClick:f=>f.stopPropagation(),children:(0,De.jsx)(mo.Checkbox,{classNames:{input:t.checkbox},...e})})}var z=require("react/jsx-runtime"),Fa=(0,zo.createStyles)(o=>{let e=o.colors[o.primaryColor][6];return{withPointerCursor:{cursor:"pointer"},selected:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.6):o.fn.lighten(e,.9)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.55):o.fn.lighten(e,.85)}}},contextMenuVisible:{"&&":{"tr&":{background:o.colorScheme==="dark"?o.fn.darken(e,.5):o.fn.lighten(e,.7)},"table[data-striped] tbody &:nth-of-type(odd)":{background:o.colorScheme==="dark"?o.fn.darken(e,.45):o.fn.lighten(e,.65)}}}}});function Te({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:n,onSelectionChange:d,isRecordSelectable:u,onClick:p,onCellClick:l,onContextMenu:m,expansion:i,customRowAttributes:I,className:s,style:C,sx:g,contextMenuVisible:B,leftShadowVisible:S}){let{cx:$,classes:q}=Fa();return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(zo.Box,{component:"tr",className:$({[q.withPointerCursor]:p||i?.expandOnClick,[q.selected]:n,[q.contextMenuVisible]:B},typeof s=="function"?s(o,e):s),onClick:R=>{if(i){let{isRowExpanded:M,expandOnClick:w,expandRow:k,collapseRow:v}=i;w&&(M(o)?v(o):k(o))}p?.(R)},style:typeof C=="function"?C(o,e):C,sx:g,...I?.(o,e),onContextMenu:m,children:[f&&(0,z.jsx)(ye,{withRightShadow:S,checked:n,disabled:!d||(u?!u(o,e):!1),onChange:d}),r.map((R,M)=>{let{accessor:w,hidden:k,visibleMediaQuery:v,textAlignment:io,noWrap:Vo,ellipsis:Go,width:Xo,render:Zo,cellsClassName:go,cellsStyle:Co,cellsSx:Qo,customCellAttributes:Ko}=R,To;return l&&(To=$o=>l({event:$o,record:o,recordIndex:e,column:R,columnIndex:M})),k?null:(0,z.jsx)(he,{className:typeof go=="function"?go(o,e):go,style:typeof Co=="function"?Co(o,e):Co,sx:Qo,visibleMediaQuery:v,record:o,recordIndex:e,onClick:To,accessor:w,textAlignment:io,noWrap:Vo,ellipsis:Go,width:Xo,render:Zo,defaultRender:t,customCellAttributes:Ko},w)})]}),i&&(0,z.jsx)(Be,{colSpan:r.filter(R=>!R.hidden).length+(f?1:0),open:i.isRowExpanded(o),content:i.content(o,e),collapseProps:i.collapseProps})]})}a();var xo=require("@mantine/core"),V=require("@mantine/hooks"),Br=require("react/jsx-runtime"),va=(0,xo.createStyles)(o=>({root:{position:"fixed",border:`1px solid ${o.colorScheme==="dark"?o.colors.dark[4]:o.colors.gray[3]}`,overflow:"hidden",transition:"all .15s ease"}}));function we({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:n,children:d}){(0,V.useWindowEvent)("resize",n),(0,V.useWindowEvent)("scroll",n);let u=(0,V.useClickOutside)(n),{ref:p,width:l,height:m}=(0,V.useElementSize)(),i=(0,V.useMergedRef)(u,p),{innerWidth:I,innerHeight:s}=window,{classes:C,theme:{dir:g,spacing:B}}=va(),S=(0,xo.px)(B.md);return(0,Br.jsx)(xo.Paper,{ref:i,shadow:e,radius:o,className:C.root,sx:{zIndex:r,top:t+m+S>s?s-m-S:t,left:g==="ltr"?f+l+S>I?I-l-S:f:I-S-(f-l-S<0?l+S:f)},children:d})}a();var Dr=require("@mantine/core"),yr=require("react/jsx-runtime"),Aa=(0,Dr.createStyles)(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function Pe(){let{classes:o}=Aa();return(0,yr.jsx)("div",{className:o.root})}a();var N=require("@mantine/core"),yo=require("react/jsx-runtime"),La=(0,N.createStyles)((o,{color:e})=>{let r=(0,N.px)(o.spacing.sm)/2;return{root:{width:"100%",display:"flex",alignItems:"center",paddingTop:r,paddingBottom:r,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,color:e&&o.colors[e][6],transition:"background .15s ease","&[disabled]":{cursor:"not-allowed",color:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[5]},"&:hover:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.15:.08:.25)},"&:active:not([disabled])":{background:o.fn.rgba(e?o.colors[e][6]:o.colorScheme==="dark"?o.colors.dark[3]:o.colors.gray[4],e?o.colorScheme==="dark"?.3:.2:.5)}},icon:{fontSize:0,marginRight:o.spacing.xs},title:{whiteSpace:"nowrap"}}});function Me({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:n}=La({color:r});return(0,yo.jsxs)(N.UnstyledButton,{className:n.root,disabled:t,onClick:f,children:[o&&(0,yo.jsx)(N.Box,{className:n.icon,children:o}),(0,yo.jsx)(N.Text,{className:n.title,size:"sm",children:e})]})}a();var Io=require("@mantine/core"),J=require("react/jsx-runtime"),Ha=(0,Io.createStyles)(o=>{let e=o.colorScheme==="dark"?.5:.05;return{root:{flex:"1 1 100%"},scrollbar:{'&[data-state="visible"]':{background:"transparent"},"div::before":{pointerEvents:"none"}},corner:{background:"transparent"},thumb:{zIndex:3},shadow:{position:"absolute",pointerEvents:"none",opacity:0,transition:"opacity .15s ease"},topShadow:{zIndex:2,top:0,left:0,right:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},leftShadow:{zIndex:3,top:0,left:0,bottom:0,width:o.spacing.sm,background:`linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to right, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},rightShadow:{zIndex:2,top:0,bottom:0,right:0,width:o.spacing.sm,background:`linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)}), linear-gradient(to left, ${o.fn.rgba(o.black,e)}, ${o.fn.rgba(o.black,0)} 30%)`},bottomShadow:{zIndex:2,left:0,right:0,bottom:0,height:o.spacing.sm,background:`linear-gradient(${o.fn.rgba(o.black,0)}, ${o.fn.rgba(o.black,e)}), linear-gradient(${o.fn.rgba(o.black,0)} 30%, ${o.fn.rgba(o.black,e)})`},shadowVisible:{opacity:1}}});function Re({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,onScrollPositionChange:n,children:d,viewportRef:u}){let{cx:p,classes:l}=Ha();return(0,J.jsxs)(Io.ScrollArea,{viewportRef:u,classNames:{root:l.root,scrollbar:l.scrollbar,thumb:l.thumb,corner:l.corner},styles:{scrollbar:{marginTop:f}},onScrollPositionChange:n,children:[d,(0,J.jsx)(Io.Box,{className:p(l.shadow,l.topShadow,{[l.shadowVisible]:o}),sx:{top:f}}),(0,J.jsx)("div",{className:p(l.shadow,l.leftShadow,{[l.shadowVisible]:e})}),(0,J.jsx)("div",{className:p(l.shadow,l.rightShadow,{[l.shadowVisible]:r})}),(0,J.jsx)("div",{className:p(l.shadow,l.bottomShadow,{[l.shadowVisible]:t})})]})}var T=require("react/jsx-runtime"),Tr={},Ea=(0,K.createStyles)((o,{borderColor:e,rowBorderColor:r})=>{let t=typeof e=="function"?e(o):e,f=typeof r=="function"?r(o):r;return{root:{position:"relative",display:"flex",flexDirection:"column",overflow:"hidden",tr:{backgroundColor:o.colorScheme==="dark"?o.colors.dark[7]:o.white},"&&":{"thead tr th":{borderBottomColor:t},"tbody tr td":{borderTopColor:f}}},lastRowBorderBottomVisible:{"tbody tr:last-of-type td":{borderBottom:`1px solid ${f}`}},textSelectionDisabled:{userSelect:"none"},table:{borderCollapse:"separate",borderSpacing:0},tableWithBorder:{border:`1px solid ${t}`},tableWithColumnBorders:{"&&":{"th, td":{":not(:first-of-type)":{borderLeft:`1px solid ${f}`}}}},verticalAlignmentTop:{td:{verticalAlign:"top"}},verticalAlignmentBottom:{td:{verticalAlign:"bottom"}}}});function Oe({withBorder:o,borderRadius:e,borderColor:r=D=>D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],rowBorderColor:t=D=>D.fn.rgba(D.colorScheme==="dark"?D.colors.dark[4]:D.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:n,height:d="100%",minHeight:u,shadow:p,verticalAlignment:l="center",fetching:m,columns:i,defaultColumnRender:I,idAccessor:s="id",records:C,selectedRecords:g,onSelectedRecordsChange:B,isRecordSelectable:S,sortStatus:$,sortIcons:q,onSortStatusChange:R,horizontalSpacing:M,page:w,onPageChange:k,totalRecords:v,recordsPerPage:io,onRecordsPerPageChange:Vo,recordsPerPageOptions:Go,recordsPerPageLabel:Xo="Records per page",paginationColor:Zo,paginationSize:go="sm",paginationText:Co=({from:D,to:So,totalRecords:eo})=>`${D} - ${So} / ${eo}`,paginationWrapBreakpoint:Qo="sm",loaderBackgroundBlur:Ko,customLoader:To,loaderSize:$o,loaderVariant:wr,loaderColor:Pr,loadingText:Mr="...",emptyState:Rr,noRecordsText:ke="No records",noRecordsIcon:Or,striped:kr,onRowClick:Yo,onCellClick:Fr,onScrollToTop:Fe,onScrollToBottom:ve,onScrollToLeft:Ae,onScrollToRight:Le,rowContextMenu:A,rowExpansion:vr,rowClassName:Ar,rowStyle:Lr,rowSx:Hr,customRowAttributes:Er,scrollViewportRef:Nr,bodyRef:qr,m:Wr,my:Ur,mx:zr,mt:Vr,mb:Gr,ml:Xr,mr:Zr,sx:Qr,className:Kr,classNames:_o,style:$r,styles:jo,...Yr}){let{ref:D,width:So,height:eo}=(0,oo.useElementSize)(),{ref:_r,height:Jo}=(0,oo.useElementSize)(),{ref:jr,width:oe,height:wo}=(0,oo.useElementSize)(),{ref:Jr,height:He}=(0,oo.useElementSize)(),[ee,Ee]=(0,G.useState)(!0),[re,Ne]=(0,G.useState)(!0),[Po,qe]=(0,G.useState)(!0),[ae,We]=(0,G.useState)(!0),{rowContextMenuInfo:Y,setRowContextMenuInfo:ro}=Sr(m),oa=hr({rowExpansion:vr,records:C,idAccessor:s}),te=(0,G.useCallback)(()=>{if(!m&&A&&ro(null),m||wo<=eo)Ee(!0),Ne(!0);else{let x=D.current.scrollTop,h=x===0,P=wo-x-eo<1;Ee(h),Ne(P),h&&h!==ee&&Fe?.(),P&&P!==re&&ve?.()}if(m||oe===So)qe(!0),We(!0);else{let x=D.current.scrollLeft,h=x===0,P=oe-x-So<1;qe(h),We(P),h&&h!==Po&&Ae?.(),P&&P!==ae&&Le?.()}},[m,ve,Ae,Le,Fe,A,eo,D,So,re,Po,ae,ee,ro,wo,oe]);cr(te,[te]);let ea=(0,G.useCallback)(x=>{D.current.scrollTo({top:0,left:0}),k(x)},[k,D]),Mo=C?.length,Ue=C?.map(x=>b(x,s)),ho=g?.map(x=>b(x,s)),ze=Ue!==void 0&&ho!==void 0&&ho.length>0,fe=S?C?.filter(S):C,Ro=fe?.map(x=>b(x,s)),Oo=ze&&Ro.every(x=>ho.includes(x)),ra=ze&&Ro.some(x=>ho.includes(x)),aa=(0,G.useCallback)(()=>{B?.(Oo?g.filter(x=>!Ro.includes(b(x,s))):lo([...g,...fe],x=>b(x,s)))},[Oo,s,B,Ro,fe,g]),{lastSelectionChangeIndex:ko,setLastSelectionChangeIndex:ta}=Cr(Ue),Ve=!!g&&!Po,{cx:Ge,classes:X,theme:fa}=Ea({borderColor:r,rowBorderColor:t}),na={m:Wr,my:Ur,mx:zr,mt:Vr,mb:Gr,ml:Xr,mr:Zr},ne=typeof jo=="function"?jo(fa,Tr,Tr):jo;return(0,T.jsxs)(K.Box,{...na,className:Ge(X.root,{[X.tableWithBorder]:o},Kr,_o?.root),sx:[x=>({borderRadius:x.radius[e]||e,boxShadow:x.shadows[p]||p,height:d,minHeight:u}),...(0,K.packSx)(Qr)],style:{...ne?.root,...$r},children:[(0,T.jsx)(Re,{viewportRef:(0,oo.useMergedRef)(D,Nr||null),topShadowVisible:!ee,leftShadowVisible:!(g||Po),rightShadowVisible:!ae,bottomShadowVisible:!re,headerHeight:Jo,onScrollPositionChange:te,children:(0,T.jsxs)(K.Table,{ref:jr,horizontalSpacing:M,className:Ge(X.table,{[X.tableWithColumnBorders]:f,[X.lastRowBorderBottomVisible]:wo<eo,[X.textSelectionDisabled]:n,[X.verticalAlignmentTop]:l==="top",[X.verticalAlignmentBottom]:l==="bottom"}),striped:Mo?kr:!1,...Yr,children:[(0,T.jsx)(mr,{ref:_r,className:_o?.header,style:ne?.header,columns:i,sortStatus:$,sortIcons:q,onSortStatusChange:R,selectionVisible:!!g,selectionChecked:Oo,selectionIndeterminate:ra&&!Oo,onSelectionChange:aa,leftShadowVisible:Ve}),(0,T.jsx)("tbody",{ref:qr,children:Mo?C.map((x,h)=>{let P=b(x,s),bo=ho?.includes(P)||!1,Fo=!1,vo=!1;if(A){let{hidden:y}=A;(!y||!(typeof y=="function"?y(x,h):y))&&(A.trigger==="click"?Fo=!0:vo=!0)}let Ao;B&&(Ao=y=>{if(y.nativeEvent.shiftKey&&ko!==null){let ao=C.filter(h>ko?(_,j)=>j>=ko&&j<=h&&(S?S(_,j):!0):(_,j)=>j>=h&&j<=ko&&(S?S(_,j):!0));B(bo?qo(g,ao,_=>b(_,s)):lo([...g,...ao],_=>b(_,s)))}else B(bo?g.filter(ao=>b(ao,s)!==P):lo([...g,x],ao=>b(ao,s)));ta(h)});let Bo;Fo?Bo=y=>{ro({y:y.clientY,x:y.clientX,record:x,recordIndex:h}),Yo?.(x,h,y)}:Yo&&(Bo=y=>{Yo(x,h,y)});let Xe;return vo&&(Xe=y=>{y.preventDefault(),ro({y:y.clientY,x:y.clientX,record:x,recordIndex:h})}),(0,T.jsx)(Te,{record:x,recordIndex:h,columns:i,defaultColumnRender:I,selectionVisible:!!g,selectionChecked:bo,onSelectionChange:Ao,isRecordSelectable:S,onClick:Bo,onCellClick:Fr,onContextMenu:Xe,contextMenuVisible:Y?b(Y.record,s)===P:!1,expansion:oa,className:Ar,style:Lr,sx:Hr,customRowAttributes:Er,leftShadowVisible:Ve},P)}):(0,T.jsx)(se,{})})]})}),w&&(0,T.jsx)(ir,{ref:Jr,className:_o?.pagination,style:ne?.pagination,topBorderColor:r,horizontalSpacing:M,fetching:m,page:w,onPageChange:ea,totalRecords:v,recordsPerPage:io,onRecordsPerPageChange:Vo,recordsPerPageOptions:Go,recordsPerPageLabel:Xo,paginationColor:Zo,paginationSize:go,paginationText:Co,paginationWrapBreakpoint:Qo,noRecordsText:ke,loadingText:Mr,recordsLength:Mo}),(0,T.jsx)(Ce,{pt:Jo,pb:He,fetching:m,backgroundBlur:Ko,customContent:To,size:$o,variant:wr,color:Pr}),(0,T.jsx)(me,{pt:Jo,pb:He,icon:Or,text:ke,active:!m&&!Mo,children:Rr}),A&&Y&&(0,T.jsx)(we,{zIndex:A.zIndex,borderRadius:A.borderRadius,shadow:A.shadow,y:Y.y,x:Y.x,onDestroy:()=>ro(null),children:A.items(Y.record,Y.recordIndex).map(({divider:x,key:h,title:P,icon:bo,color:Fo,hidden:vo,disabled:Ao,onClick:Bo})=>x?(0,T.jsx)(Pe,{},h):vo?null:(0,T.jsx)(Me,{title:P??no(h),icon:bo,color:Fo,disabled:Ao,onClick:()=>{ro(null),Bo()}},h))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();
2
2
  //# sourceMappingURL=index.cjs.map