mantine-datatable 2.5.3 → 2.5.5

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.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var ta=Object.create;var Me=Object.defineProperty;var fa=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var la=Object.getPrototypeOf,sa=Object.prototype.hasOwnProperty;var da=(o,e)=>()=>(o&&(e=o(o=0)),e);var Uo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ca=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of na(e))!sa.call(o,f)&&f!==r&&Me(o,f,{get:()=>e[f],enumerable:!(t=fa(e,f))||t.enumerable});return o};var ua=(o,e,r)=>(r=o!=null?ta(la(o)):{},ca(e||!o||!o.__esModule?Me(r,"default",{value:o,enumerable:!0}):r,o));import*as s from"react";var a=da(()=>{"use strict"});var Ae=Uo((gf,ve)=>{"use strict";a();var xa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ve.exports=xa});var Ne=Uo((Sf,Ee)=>{"use strict";a();var Ia=Ae();function Le(){}function He(){}He.resetWarningCache=Le;Ee.exports=function(){function o(t,f,l,n,d,p){if(p!==Ia){var x=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 x.name="Invariant Violation",x}}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:He,resetWarningCache:Le};return r.PropTypes=r,r}});var We=Uo((Df,qe)=>{a();qe.exports=Ne()();var bf,Bf});a();a();import{Box as tf,createStyles as ff,packSx as nf,Table as lf}from"@mantine/core";import{useElementSize as no,useMergedRef as sf}from"@mantine/hooks";import{useCallback as ie,useState as To}from"react";a();import{createStyles as pa}from"@mantine/core";import{jsx as Oe}from"react/jsx-runtime";var ma=pa({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Vo(){let{classes:o}=ma();return Oe("tr",{className:o.root,children:Oe("td",{})})}a();import{Center as Ba,createStyles as Da,Text as ya}from"@mantine/core";a();a();var N=ua(We());import{forwardRef as ia,createElement as Ue}from"react";a();var ze={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 ga=Object.defineProperty,Ca=Object.defineProperties,Sa=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ve=(o,e,r)=>e in o?ga(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e)=>{for(var r in e||(e={}))Xe.call(e,r)&&Ve(o,r,e[r]);if(ho)for(var r of ho(e))Qe.call(e,r)&&Ve(o,r,e[r]);return o},ha=(o,e)=>Ca(o,Sa(e)),ba=(o,e)=>{var r={};for(var t in o)Xe.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&&Qe.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=ia((f,l)=>{var n=f,{color:d="currentColor",size:p=24,stroke:x=2,children:c}=n,u=ba(n,["color","size","stroke","children"]);return Ue("svg",Ge(ha(Ge({ref:l},ze),{width:p,height:p,stroke:d,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),u),[...r.map(([I,m])=>Ue(I,m)),...c||[]])});return t.propTypes={color:N.default.string,size:N.default.oneOfType([N.default.string,N.default.number]),stroke:N.default.oneOfType([N.default.string,N.default.number])},t.displayName=`${e}`,t};a();var Go=q("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 Xo=q("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 Qo=q("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"}]]);a();var Zo=q("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);import{Fragment as Pa,jsx as bo,jsxs as wa}from"react/jsx-runtime";var Ta=Da(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 Ko({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:d}=Ta();return bo(Ba,{pt:r,pb:t,className:d(n.root,{[n.active]:f}),children:l||wa(Pa,{children:[o||bo("div",{className:n.standardIcon,children:bo(Qo,{})}),bo(ya,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Wa,createStyles as za}from"@mantine/core";import{forwardRef as Ua}from"react";a();import{Box as Oa,createStyles as va}from"@mantine/core";a();import{useMantineTheme as ka}from"@mantine/core";import{useMediaQuery as Ra}from"@mantine/hooks";import{useEffect as Fa,useLayoutEffect as Ma}from"react";var Ze=typeof window<"u"?Ma:Fa;function K(o){let e=ka(),r=typeof o=="function"?o(e):o;return Ra(r||"",!0)}function ao(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 $o(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function to(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function D(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as La}from"react/jsx-runtime";var Aa=va({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Yo({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:d,width:p}){let{cx:x,classes:c}=Aa();return K(t)?La(Oa,{component:"th",className:x({[c.noWrap]:l||n,[c.ellipsis]:n},o),sx:[{"&&":{textAlign:d},width:p,minWidth:p,maxWidth:p},e],style:r,children:f}):null}a();import{createStyles as Ha,px as Ea}from"@mantine/core";import{jsx as qa}from"react/jsx-runtime";var Na=Ha(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:-Ea(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}}}});function _o({shadowVisible:o}){let{cx:e,classes:r}=Na();return qa("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as jo,jsxs as Ga}from"react/jsx-runtime";var Va=za((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),Ke=Ua(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:d},p){let{cx:x,classes:c}=Va({scrollDiff:d,borderColor:t});return jo(Wa,{component:"tfoot",ref:p,className:x(c.root,e),style:r,children:Ga("tr",{children:[l&&jo(_o,{shadowVisible:n}),f.map(({accessor:u,hidden:I,visibleMediaQuery:m,textAlignment:S,width:g,footer:h,footerClassName:C,footerStyle:R,footerSx:k,noWrap:v,ellipsis:T})=>I?null:jo(Yo,{className:C,style:R,sx:k,visibleMediaQuery:m,textAlignment:S,width:g,title:h,noWrap:v,ellipsis:T},u))]})})});a();import{createStyles as rt}from"@mantine/core";import{forwardRef as at}from"react";a();import{Box as $e,Center as Ye,createStyles as Xa,Group as Qa,ActionIcon as Za,Popover as Jo}from"@mantine/core";import{useDisclosure as Ka}from"@mantine/hooks";import{Fragment as _a,jsx as M,jsxs as _e}from"react/jsx-runtime";var $a=Xa(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button: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 Ya({children:o,isActive:e}){let[r,{close:t,toggle:f}]=Ka(!1);return _e(Jo,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[M(Jo.Target,{children:M(Za,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:M(Zo,{size:14})})}),M(Jo.Dropdown,{children:typeof o=="function"?o({close:t}):o})]})}function oe({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:d,textAlignment:p,width:x,sortStatus:c,onSortStatusChange:u,filter:I,filtering:m}){let{cx:S,classes:g}=$a();if(!K(f))return null;let h=l??ao(t),C=typeof h=="string"?h:void 0,R=n&&u?k=>{k?.defaultPrevented||u({columnAccessor:t,direction:c?.columnAccessor===t?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0;return M($e,{component:"th",className:S({[g.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:p},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:R,onKeyDown:k=>k.key==="Enter"&&R?.(),children:_e(Qa,{className:g.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[M($e,{className:S(g.columnHeaderText,g.sortableColumnHeaderText),title:C,children:h}),n||c?.columnAccessor===t?M(_a,{children:c?.columnAccessor===t?M(Ye,{className:S(g.sortableColumnHeaderIcon,{[g.sortableColumnHeaderIconRotated]:c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||M(Go,{size:14})}):M(Ye,{className:g.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:d?.unsorted||M(Xo,{size:14})})}):null,I?M(Ya,{isActive:!!m,children:I}):null]})})}a();import{Checkbox as ja,createStyles as Ja,px as ot}from"@mantine/core";import{jsx as je}from"react/jsx-runtime";var et=Ja(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:-ot(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 ee({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=et();return je("th",{className:l(n.root,{[n.shadowVisible]:o}),children:je(ja,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as re,jsxs as ft}from"react/jsx-runtime";var tt=rt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Je=at(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:d,selectionChecked:p,selectionIndeterminate:x,onSelectionChange:c,selectionCheckboxProps:u,leftShadowVisible:I},m){let{classes:S,cx:g}=tt();return re("thead",{className:g(S.root,e),style:r,ref:m,children:ft("tr",{children:[d&&re(ee,{shadowVisible:I,checked:p,indeterminate:x,checkboxProps:u,onChange:c}),n.map(({accessor:h,hidden:C,visibleMediaQuery:R,textAlignment:k,width:v,title:T,sortable:F,titleClassName:P,titleStyle:A,titleSx:L,filter:W,filtering:Y})=>C?null:re(oe,{className:P,style:A,sx:L,accessor:h,visibleMediaQuery:R,textAlignment:k,width:v,title:T,sortable:F,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:W,filtering:Y},h))]})})});a();import{Center as nt,createStyles as lt,Loader as st}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var dt=lt(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 ae({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:d}){let{classes:p,cx:x}=dt();return or(nt,{pt:o,pb:e,className:x(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||or(st,{size:l,variant:n,color:d}))})}a();import{Box as pt,Pagination as mt,Text as xt,createStyles as It}from"@mantine/core";import{forwardRef as it}from"react";a();import{Button as ct,Group as ut,Menu as Bo,Text as er}from"@mantine/core";import{jsx as $,jsxs as ar}from"react/jsx-runtime";var rr={xs:22,sm:26,md:32,lg:38,xl:44};function te({size:o,label:e,values:r,value:t,onChange:f,color:l}){return ar(ut,{spacing:"xs",children:[$(er,{size:o,children:e}),ar(Bo,{withinPortal:!0,withArrow:!0,children:[$(Bo.Target,{children:$(ct,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:rr[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),$(Bo.Dropdown,{children:r.map(n=>{let d=n===t;return $(Bo.Item,{sx:[{height:rr[o]},p=>({"&&":{color:d?p.white:void 0},background:d?p.colors[l||p.primaryColor][6]:void 0})],disabled:d,onClick:()=>f(n),children:$(er,{size:o,children:n})},n)})})]})]})}import{jsx as fe,jsxs as Ct}from"react/jsx-runtime";var gt=It((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}})),tr=it(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:d,paginationSize:p,loadingText:x,noRecordsText:c,paginationText:u,totalRecords:I,recordsPerPage:m,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:C,horizontalSpacing:R,paginationWrapBreakpoint:k,getPaginationControlProps:v},T){let F;if(f)F=x;else if(!I)F=c;else{let L=(l-1)*m+1,W=L+C-1;F=u({from:L,to:W,totalRecords:I})}let{classes:P,cx:A}=gt({topBorderColor:t,paginationWrapBreakpoint:k});return Ct(pt,{ref:T,px:R??"xs",py:"xs",className:A(P.root,e),style:r,children:[fe(xt,{className:P.text,size:p,children:F}),h&&fe(te,{size:p,label:g,values:h,color:d,value:m,onChange:S}),fe(mt,{color:d,className:A(P.pagination,{[P.paginationFetching]:f||!C}),value:l,onChange:n,size:p,total:Math.ceil(I/m),getControlProps:v})]})});a();import{Box as Ot,createStyles as vt}from"@mantine/core";a();import{Box as St,createStyles as ht}from"@mantine/core";import{jsx as Bt}from"react/jsx-runtime";var bt=ht({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function ne({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:d,ellipsis:p,textAlignment:x,width:c,accessor:u,render:I,defaultRender:m,customCellAttributes:S}){let{cx:g,classes:h}=bt();return K(t)?Bt(St,{component:"td",className:g({[h.noWrap]:d||p,[h.ellipsis]:p,[h.withPointerCursor]:n},o),sx:[{width:c,minWidth:c,maxWidth:c,textAlign:x},e],style:r,onClick:n,...S?.(f,l),children:I?I(f,l):m?m(f,l,u):D(f,u)}):null}a();import{Collapse as Dt,createStyles as yt}from"@mantine/core";a();import{useTimeout as fr}from"@mantine/hooks";import{useEffect as le,useState as fo}from"react";function nr(o){let[e,r]=fo(null),t=o?.join(":")||"";return le(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function lr(o){let[e,r]=fo(null);return le(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function sr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:d,allowMultiple:p,initiallyExpanded:x}=o;e&&d==="always"?t=e.map(c=>D(c,r)):x&&(t=e.filter(x).map(c=>D(c,r)),p||(t=[t[0]]))}let f,l,n=fo(t);if(o){let{trigger:d,allowMultiple:p,collapseProps:x,content:c}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let u=I=>l?.(f.filter(m=>m!==D(I,r)));return{expandOnClick:d!=="always"&&d!=="never",isRowExpanded:I=>d==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let m=D(I,r);l?.(p?[...f,m]:[m])},collapseRow:u,collapseProps:x,content:(I,m)=>()=>c({record:I,recordIndex:m,collapse:()=>u(I)})}}}function dr(o,e){let[r,t]=fo(o),[f,l]=fo(o),n=fr(()=>t(!0),0),d=fr(()=>l(!1),e||200);return le(()=>{o?(d.clear(),l(!0),n.start()):(n.clear(),t(!1),d.start())},[n,d,o]),{expanded:r,visible:f}}import{Fragment as Pt,jsx as Do,jsxs as wt}from"react/jsx-runtime";var Tt=yt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function se({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=dr(o,t?.transitionDuration),{cx:n,classes:d}=Tt();return l?wt(Pt,{children:[Do("tr",{}),Do("tr",{children:Do("td",{className:n(d.cell,{[d.expandedCell]:f}),colSpan:e,children:Do(Dt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as kt,createStyles as Rt,px as Ft}from"@mantine/core";import{jsx as cr}from"react/jsx-runtime";var Mt=Rt(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:-Ft(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({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Mt();return cr("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:d=>d.stopPropagation(),children:cr(kt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Lt,jsx as ce,jsxs as ur}from"react/jsx-runtime";var At=vt(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 ue({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:d,getSelectionCheckboxProps:p,onClick:x,onCellClick:c,onContextMenu:u,expansion:I,customRowAttributes:m,className:S,style:g,sx:h,contextMenuVisible:C,leftShadowVisible:R}){let{cx:k,classes:v}=At();return ur(Lt,{children:[ur(Ot,{component:"tr",className:k({[v.withPointerCursor]:x||I?.expandOnClick,[v.selected]:l,[v.contextMenuVisible]:C},typeof S=="function"?S(o,e):S),onClick:T=>{if(I){let{isRowExpanded:F,expandOnClick:P,expandRow:A,collapseRow:L}=I;P&&(F(o)?L(o):A(o))}x?.(T)},style:typeof g=="function"?g(o,e):g,sx:h,...m?.(o,e),onContextMenu:u,children:[f&&ce(de,{record:o,recordIndex:e,withRightShadow:R,checked:l,disabled:!n||(d?!d(o,e):!1),onChange:n,getCheckboxProps:p}),r.map((T,F)=>{let{accessor:P,hidden:A,visibleMediaQuery:L,textAlignment:W,noWrap:Y,ellipsis:Po,width:wo,render:ko,cellsClassName:_,cellsStyle:j,cellsSx:Ro,customCellAttributes:Fo}=T,lo;return c&&(lo=Mo=>c({event:Mo,record:o,recordIndex:e,column:T,columnIndex:F})),A?null:ce(ne,{className:typeof _=="function"?_(o,e):_,style:typeof j=="function"?j(o,e):j,sx:Ro,visibleMediaQuery:L,record:o,recordIndex:e,onClick:lo,accessor:P,textAlignment:W,noWrap:Y,ellipsis:Po,width:wo,render:ko,defaultRender:t,customCellAttributes:Fo},P)})]}),I&&ce(se,{colSpan:r.filter(T=>!T.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Ht,Paper as Et,px as Nt}from"@mantine/core";import{useClickOutside as qt,useElementSize as Wt,useMergedRef as zt,useWindowEvent as pr}from"@mantine/hooks";import{jsx as Vt}from"react/jsx-runtime";var Ut=Ht(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 pe({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){pr("resize",l),pr("scroll",l);let d=qt(l),{ref:p,width:x,height:c}=Wt(),u=zt(d,p),{innerWidth:I,innerHeight:m}=window,{classes:S,theme:{dir:g,spacing:h}}=Ut(),C=Nt(h.md);return Vt(Et,{ref:u,shadow:e,radius:o,className:S.root,sx:{zIndex:r,top:t+c+C>m?m-c-C:t,left:g==="ltr"?f+x+C>I?I-x-C:f:I-C-(f-x-C<0?x+C:f)},children:n})}a();import{createStyles as Gt}from"@mantine/core";import{jsx as Qt}from"react/jsx-runtime";var Xt=Gt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function me(){let{classes:o}=Xt();return Qt("div",{className:o.root})}a();import{Box as Zt,Text as Kt,UnstyledButton as $t,createStyles as Yt,px as _t}from"@mantine/core";import{jsx as mr,jsxs as Jt}from"react/jsx-runtime";var jt=Yt((o,{color:e})=>{let r=_t(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 xe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=jt({color:r});return Jt($t,{className:l.root,disabled:t,onClick:f,children:[o&&mr(Zt,{className:l.icon,children:o}),mr(Kt,{className:l.title,size:"sm",children:e})]})}a();import{Box as xr,createStyles as of,ScrollArea as ef}from"@mantine/core";import{jsx as yo,jsxs as af}from"react/jsx-runtime";var rf=of(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,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,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 Ie({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:d,viewportRef:p}){let x=l?l-1:0,{cx:c,classes:u}=rf();return af(ef,{viewportRef:p,classNames:{root:u.root,scrollbar:u.scrollbar,thumb:u.thumb,corner:u.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[d,yo(xr,{className:c(u.shadow,u.topShadow,{[u.shadowVisible]:o}),sx:{top:f}}),yo("div",{className:c(u.shadow,u.leftShadow,{[u.shadowVisible]:e})}),yo("div",{className:c(u.shadow,u.rightShadow,{[u.shadowVisible]:r})}),yo(xr,{className:c(u.shadow,u.bottomShadow,{[u.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as O,jsxs as ir}from"react/jsx-runtime";var Ir={},df=ff((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 gr({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:l,height:n="100%",minHeight:d,shadow:p,verticalAlignment:x="center",fetching:c,columns:u,defaultColumnRender:I,idAccessor:m="id",records:S,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:C,allRecordsSelectionCheckboxProps:R={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:k=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:v,sortIcons:T,onSortStatusChange:F,horizontalSpacing:P,page:A,onPageChange:L,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:wo,recordsPerPageLabel:ko="Records per page",paginationColor:_,paginationSize:j="sm",paginationText:Ro=({from:B,to:z,totalRecords:U})=>`${B} - ${z} / ${U}`,paginationWrapBreakpoint:Fo="sm",getPaginationControlProps:lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Mo,customLoader:Cr,loaderSize:Sr,loaderVariant:hr,loaderColor:br,loadingText:Br="...",emptyState:Dr,noRecordsText:ge="No records",noRecordsIcon:yr,striped:Tr,noHeader:Pr,onRowClick:Oo,onCellClick:wr,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:he,onScrollToRight:be,rowContextMenu:H,rowExpansion:kr,rowClassName:Rr,rowStyle:Fr,rowSx:Mr,customRowAttributes:Or,scrollViewportRef:vr,bodyRef:Ar,m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr,sx:Ur,className:Vr,classNames:so,style:Gr,styles:vo,...Xr}){let{ref:B,width:z,height:U}=no(),{ref:Qr,height:Ao}=no(),{ref:Zr,width:Lo,height:J}=no(),{ref:Kr,height:$r}=no(),{ref:Yr,height:Be}=no(),[Ho,De]=To(!0),[Eo,ye]=To(!0),[co,Te]=To(!0),[No,Pe]=To(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:Q}=lr(c),_r=sr({rowExpansion:kr,records:S,idAccessor:m}),qo=ie(()=>{if(!c&&H&&Q(null),c||J<=U)De(!0),ye(!0);else{let i=B.current.scrollTop,b=i===0,w=J-i-U<1;De(b),ye(w),b&&b!==Ho&&Ce?.(),w&&w!==Eo&&Se?.()}if(c||Lo===z)Te(!0),Pe(!0);else{let i=B.current.scrollLeft,b=i===0,w=Lo-i-z<1;Te(b),Pe(w),b&&b!==co&&he?.(),w&&w!==No&&be?.()}},[c,Se,he,be,Ce,H,U,B,z,Eo,co,No,Ho,Q,J,Lo]);Ze(qo,[qo]);let jr=ie(i=>{B.current.scrollTo({top:0,left:0}),L(i)},[L,B]),uo=S?.length,we=S?.map(i=>D(i,m)),po=!!g,oo=g?.map(i=>D(i,m)),ke=we!==void 0&&oo!==void 0&&oo.length>0,Wo=C?S?.filter(C):S,mo=Wo?.map(i=>D(i,m)),xo=ke&&mo.every(i=>oo.includes(i)),Jr=ke&&mo.some(i=>oo.includes(i)),oa=ie(()=>{h?.(xo?g.filter(i=>!mo.includes(D(i,m))):to([...g,...Wo],i=>D(i,m)))},[xo,m,h,mo,Wo,g]),{lastSelectionChangeIndex:Io,setLastSelectionChangeIndex:ea}=nr(we),zo=po&&!co,{cx:Re,classes:E,theme:ra}=df({borderColor:r,rowBorderColor:t}),aa={m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr},io=typeof vo=="function"?vo(ra,Ir,Ir):vo;return ir(tf,{...aa,className:Re(E.root,{[E.tableWithBorder]:o},Vr,so?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[p]||p,height:n,minHeight:d}),...nf(Ur)],style:{...io?.root,...Gr},children:[O(Ie,{viewportRef:sf(B,vr||null),topShadowVisible:!Ho,leftShadowVisible:!(g||co),rightShadowVisible:!No,bottomShadowVisible:!Eo,headerHeight:Ao,footerHeight:$r,onScrollPositionChange:qo,children:ir(lf,{ref:Zr,horizontalSpacing:P,className:Re(E.table,{[E.tableWithColumnBorders]:f,[E.lastRowBorderBottomVisible]:J<U,[E.textSelectionDisabled]:l,[E.verticalAlignmentTop]:x==="top",[E.verticalAlignmentBottom]:x==="bottom"}),striped:uo?Tr:!1,...Xr,children:[Pr?null:O(Je,{ref:Qr,className:so?.header,style:io?.header,columns:u,sortStatus:v,sortIcons:T,onSortStatusChange:F,selectionVisible:po,selectionChecked:xo,selectionIndeterminate:Jr&&!xo,onSelectionChange:oa,selectionCheckboxProps:R,leftShadowVisible:zo}),O("tbody",{ref:Ar,children:uo?S.map((i,b)=>{let w=D(i,m),eo=oo?.includes(w)||!1,go=!1,Co=!1;if(H){let{hidden:y}=H;(!y||!(typeof y=="function"?y(i,b):y))&&(H.trigger==="click"?go=!0:Co=!0)}let So;h&&(So=y=>{if(y.nativeEvent.shiftKey&&Io!==null){let Z=S.filter(b>Io?(G,X)=>X>=Io&&X<=b&&(C?C(G,X):!0):(G,X)=>X>=b&&X<=Io&&(C?C(G,X):!0));h(eo?$o(g,Z,G=>D(G,m)):to([...g,...Z],G=>D(G,m)))}else h(eo?g.filter(Z=>D(Z,m)!==w):to([...g,i],Z=>D(Z,m)));ea(b)});let ro;go?ro=y=>{Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),Oo?.(i,b,y)}:Oo&&(ro=y=>{Oo(i,b,y)});let Fe;return Co&&(Fe=y=>{y.preventDefault(),Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),O(ue,{record:i,recordIndex:b,columns:u,defaultColumnRender:I,selectionVisible:po,selectionChecked:eo,onSelectionChange:So,isRecordSelectable:C,getSelectionCheckboxProps:k,onClick:ro,onCellClick:wr,onContextMenu:Fe,contextMenuVisible:V?D(V.record,m)===w:!1,expansion:_r,className:Rr,style:Fr,sx:Mr,customRowAttributes:Or,leftShadowVisible:zo},w)}):O(Vo,{})}),u.some(i=>i.footer)&&O(Ke,{ref:Kr,className:so?.footer,style:io?.footer,borderColor:r,columns:u,selectionVisible:po,leftShadowVisible:zo,scrollDiff:J-U})]})}),A&&O(tr,{ref:Yr,className:so?.pagination,style:io?.pagination,topBorderColor:r,horizontalSpacing:P,fetching:c,page:A,onPageChange:jr,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:Po,recordsPerPageOptions:wo,recordsPerPageLabel:ko,paginationColor:_,paginationSize:j,paginationText:Ro,paginationWrapBreakpoint:Fo,getPaginationControlProps:lo,noRecordsText:ge,loadingText:Br,recordsLength:uo}),O(ae,{pt:Ao,pb:Be,fetching:c,backgroundBlur:Mo,customContent:Cr,size:Sr,variant:hr,color:br}),O(Ko,{pt:Ao,pb:Be,icon:yr,text:ge,active:!c&&!uo,children:Dr}),H&&V&&O(pe,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:V.y,x:V.x,onDestroy:()=>Q(null),children:H.items(V.record,V.recordIndex).map(({divider:i,key:b,title:w,icon:eo,color:go,hidden:Co,disabled:So,onClick:ro})=>i?O(me,{},b):Co?null:O(xe,{title:w??ao(b),icon:eo,color:go,disabled:So,onClick:()=>{Q(null),ro()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{gr as DataTable,$o as differenceBy,D as getValueAtPath,ao as humanize,to as uniqBy};
1
+ var ta=Object.create;var Me=Object.defineProperty;var fa=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var la=Object.getPrototypeOf,da=Object.prototype.hasOwnProperty;var sa=(o,e)=>()=>(o&&(e=o(o=0)),e);var Uo=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ca=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of na(e))!da.call(o,f)&&f!==r&&Me(o,f,{get:()=>e[f],enumerable:!(t=fa(e,f))||t.enumerable});return o};var ua=(o,e,r)=>(r=o!=null?ta(la(o)):{},ca(e||!o||!o.__esModule?Me(r,"default",{value:o,enumerable:!0}):r,o));import*as d from"react";var a=sa(()=>{"use strict"});var Ae=Uo((gf,ve)=>{"use strict";a();var xa="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ve.exports=xa});var Ne=Uo((Sf,Ee)=>{"use strict";a();var Ia=Ae();function Le(){}function He(){}He.resetWarningCache=Le;Ee.exports=function(){function o(t,f,l,n,s,p){if(p!==Ia){var x=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 x.name="Invariant Violation",x}}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:He,resetWarningCache:Le};return r.PropTypes=r,r}});var We=Uo((Df,qe)=>{a();qe.exports=Ne()();var bf,Bf});a();a();import{Box as tf,createStyles as ff,packSx as nf,Table as lf}from"@mantine/core";import{useElementSize as no,useMergedRef as df}from"@mantine/hooks";import{useCallback as ie,useState as wo}from"react";a();import{createStyles as pa}from"@mantine/core";import{jsx as Oe}from"react/jsx-runtime";var ma=pa({root:{"&&":{background:"transparent",":last-of-type td":{borderBottom:"none"}}}});function Vo(){let{classes:o}=ma();return Oe("tr",{className:o.root,children:Oe("td",{})})}a();import{Center as Ba,createStyles as Da,Text as ya}from"@mantine/core";a();a();var N=ua(We());import{forwardRef as ia,createElement as Ue}from"react";a();var ze={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 ga=Object.defineProperty,Ca=Object.defineProperties,Sa=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ve=(o,e,r)=>e in o?ga(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ge=(o,e)=>{for(var r in e||(e={}))Xe.call(e,r)&&Ve(o,r,e[r]);if(ho)for(var r of ho(e))Qe.call(e,r)&&Ve(o,r,e[r]);return o},ha=(o,e)=>Ca(o,Sa(e)),ba=(o,e)=>{var r={};for(var t in o)Xe.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&&Qe.call(o,t)&&(r[t]=o[t]);return r},q=(o,e,r)=>{let t=ia((f,l)=>{var n=f,{color:s="currentColor",size:p=24,stroke:x=2,children:c}=n,u=ba(n,["color","size","stroke","children"]);return Ue("svg",Ge(ha(Ge({ref:l},ze),{width:p,height:p,stroke:s,strokeWidth:x,className:`tabler-icon tabler-icon-${o}`}),u),[...r.map(([I,m])=>Ue(I,m)),...c||[]])});return t.propTypes={color:N.default.string,size:N.default.oneOfType([N.default.string,N.default.number]),stroke:N.default.oneOfType([N.default.string,N.default.number])},t.displayName=`${e}`,t};a();var Go=q("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 Xo=q("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 Qo=q("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"}]]);a();var Zo=q("filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);import{Fragment as Ta,jsx as bo,jsxs as Pa}from"react/jsx-runtime";var wa=Da(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 Ko({icon:o,text:e,pt:r,pb:t,active:f,children:l}){let{classes:n,cx:s}=wa();return bo(Ba,{pt:r,pb:t,className:s(n.root,{[n.active]:f}),children:l||Pa(Ta,{children:[o||bo("div",{className:n.standardIcon,children:bo(Qo,{})}),bo(ya,{size:"sm",color:"dimmed",children:e})]})})}a();import{Box as Wa,createStyles as za}from"@mantine/core";import{forwardRef as Ua}from"react";a();import{Box as Oa,createStyles as va}from"@mantine/core";a();import{useMantineTheme as Ra}from"@mantine/core";import{useMediaQuery as ka}from"@mantine/hooks";import{useEffect as Fa,useLayoutEffect as Ma}from"react";var Ze=typeof window<"u"?Ma:Fa;function K(o){let e=Ra(),r=typeof o=="function"?o(e):o;return ka(r||"",!0)}function ao(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 $o(o,e,r){return o.filter(t=>!e.map(r).includes(r(t)))}function to(o,e){return o.filter((r,t,f)=>t===f.findIndex(l=>e(r)===e(l)))}function D(o,e){return e?e.match(/([^[.\]])+/g).reduce((t,f)=>t&&t[f],o):void 0}import{jsx as La}from"react/jsx-runtime";var Aa=va({noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function Yo({className:o,sx:e,style:r,visibleMediaQuery:t,title:f,noWrap:l,ellipsis:n,textAlignment:s,width:p}){let{cx:x,classes:c}=Aa();return K(t)?La(Oa,{component:"th",className:x({[c.noWrap]:l||n,[c.ellipsis]:n},o),sx:[{"&&":{textAlign:s},width:p,minWidth:p,maxWidth:p},e],style:r,children:f}):null}a();import{createStyles as Ha,px as Ea}from"@mantine/core";import{jsx as qa}from"react/jsx-runtime";var Na=Ha(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:-Ea(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}}}});function _o({shadowVisible:o}){let{cx:e,classes:r}=Na();return qa("th",{className:e(r.root,{[r.shadowVisible]:o})})}import{jsx as jo,jsxs as Ga}from"react/jsx-runtime";var Va=za((o,{scrollDiff:e,borderColor:r})=>{let t=e<0,f=typeof r=="function"?r(o):r;return{root:{zIndex:2,position:t?"relative":"sticky",bottom:t?e:-1,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white,"&& tr th":{borderTopColor:f}},relative:{position:"relative"},textSelectionDisabled:{userSelect:"none"}}}),Ke=Ua(function({className:e,style:r,borderColor:t,columns:f,selectionVisible:l,leftShadowVisible:n,scrollDiff:s},p){let{cx:x,classes:c}=Va({scrollDiff:s,borderColor:t});return jo(Wa,{component:"tfoot",ref:p,className:x(c.root,e),style:r,children:Ga("tr",{children:[l&&jo(_o,{shadowVisible:n}),f.map(({accessor:u,hidden:I,visibleMediaQuery:m,textAlignment:S,width:g,footer:h,footerClassName:C,footerStyle:k,footerSx:R,noWrap:v,ellipsis:w})=>I?null:jo(Yo,{className:C,style:k,sx:R,visibleMediaQuery:m,textAlignment:S,width:g,title:h,noWrap:v,ellipsis:w},u))]})})});a();import{createStyles as rt}from"@mantine/core";import{forwardRef as at}from"react";a();import{Box as $e,Center as Ye,createStyles as Xa,Group as Qa,ActionIcon as Za,Popover as Jo}from"@mantine/core";import{useDisclosure as Ka}from"@mantine/hooks";import{Fragment as _a,jsx as M,jsxs as _e}from"react/jsx-runtime";var $a=Xa(o=>({sortableColumnHeader:{cursor:"pointer",transition:"background .15s ease","&:hover:not(:has(button: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 Ya({children:o,isActive:e}){let[r,{close:t,toggle:f}]=Ka(!1);return _e(Jo,{withArrow:!0,withinPortal:!0,shadow:"md",opened:r,onClose:t,trapFocus:!0,children:[M(Jo.Target,{children:M(Za,{onClick:l=>{l.preventDefault(),f()},variant:e?"default":"subtle",children:M(Zo,{size:14})})}),M(Jo.Dropdown,{children:typeof o=="function"?o({close:t}):o})]})}function oe({className:o,sx:e,style:r,accessor:t,visibleMediaQuery:f,title:l,sortable:n,sortIcons:s,textAlignment:p,width:x,sortStatus:c,onSortStatusChange:u,filter:I,filtering:m}){let{cx:S,classes:g}=$a();if(!K(f))return null;let h=l??ao(t),C=typeof h=="string"?h:void 0,k=n&&u?R=>{R?.defaultPrevented||u({columnAccessor:t,direction:c?.columnAccessor===t?c.direction==="asc"?"desc":"asc":c?.direction??"asc"})}:void 0;return M($e,{component:"th",className:S({[g.sortableColumnHeader]:n},o),sx:[{"&&":{textAlign:p},width:x,minWidth:x,maxWidth:x},e],style:r,role:n?"button":void 0,tabIndex:n?0:void 0,onClick:k,onKeyDown:R=>R.key==="Enter"&&k?.(),children:_e(Qa,{className:g.sortableColumnHeaderGroup,position:"apart",noWrap:!0,children:[M($e,{className:S(g.columnHeaderText,g.sortableColumnHeaderText),title:C,children:h}),n||c?.columnAccessor===t?M(_a,{children:c?.columnAccessor===t?M(Ye,{className:S(g.sortableColumnHeaderIcon,{[g.sortableColumnHeaderIconRotated]:c.direction==="desc"}),role:"img","aria-label":`Sorted ${c.direction==="desc"?"descending":"ascending"}`,children:s?.sorted||M(Go,{size:14})}):M(Ye,{className:g.sortableColumnHeaderUnsortedIcon,role:"img","aria-label":"Not sorted",children:s?.unsorted||M(Xo,{size:14})})}):null,I?M(Ya,{isActive:!!m,children:I}):null]})})}a();import{Checkbox as ja,createStyles as Ja,px as ot}from"@mantine/core";import{jsx as je}from"react/jsx-runtime";var et=Ja(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:-ot(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 ee({shadowVisible:o,checked:e,indeterminate:r,checkboxProps:t,onChange:f}){let{cx:l,classes:n}=et();return je("th",{className:l(n.root,{[n.shadowVisible]:o}),children:je(ja,{classNames:{input:n.checkboxInput},checked:e,indeterminate:r,disabled:!f,onChange:f,...t})})}import{jsx as re,jsxs as ft}from"react/jsx-runtime";var tt=rt(o=>({root:{zIndex:2,position:"sticky",top:0,background:o.colorScheme==="dark"?o.colors.dark[7]:o.white},textSelectionDisabled:{userSelect:"none"}})),Je=at(function({className:e,style:r,sortStatus:t,sortIcons:f,onSortStatusChange:l,columns:n,selectionVisible:s,selectionChecked:p,selectionIndeterminate:x,onSelectionChange:c,selectionCheckboxProps:u,leftShadowVisible:I},m){let{classes:S,cx:g}=tt();return re("thead",{className:g(S.root,e),style:r,ref:m,children:ft("tr",{children:[s&&re(ee,{shadowVisible:I,checked:p,indeterminate:x,checkboxProps:u,onChange:c}),n.map(({accessor:h,hidden:C,visibleMediaQuery:k,textAlignment:R,width:v,title:w,sortable:F,titleClassName:T,titleStyle:A,titleSx:L,filter:W,filtering:Y})=>C?null:re(oe,{className:T,style:A,sx:L,accessor:h,visibleMediaQuery:k,textAlignment:R,width:v,title:w,sortable:F,sortStatus:t,sortIcons:f,onSortStatusChange:l,filter:W,filtering:Y},h))]})})});a();import{Center as nt,createStyles as lt,Loader as dt}from"@mantine/core";import{jsx as or}from"react/jsx-runtime";var st=lt(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 ae({pt:o,pb:e,fetching:r,customContent:t,backgroundBlur:f,size:l,variant:n,color:s}){let{classes:p,cx:x}=st();return or(nt,{pt:o,pb:e,className:x(p.root,{[p.fetching]:r}),sx:f?{backdropFilter:`blur(${f}px)`}:void 0,children:r&&(t||or(dt,{size:l,variant:n,color:s}))})}a();import{Box as pt,Pagination as mt,Text as xt,createStyles as It}from"@mantine/core";import{forwardRef as it}from"react";a();import{Button as ct,Group as ut,Menu as Bo,Text as er}from"@mantine/core";import{jsx as $,jsxs as ar}from"react/jsx-runtime";var rr={xs:22,sm:26,md:32,lg:38,xl:44};function te({size:o,label:e,values:r,value:t,onChange:f,color:l}){return ar(ut,{spacing:"xs",children:[$(er,{size:o,children:e}),ar(Bo,{withinPortal:!0,withArrow:!0,children:[$(Bo.Target,{children:$(ct,{size:o,variant:"default",sx:[{fontWeight:"normal"},n=>({height:rr[o],paddingLeft:n.spacing[o],paddingRight:n.spacing[o]})],children:t})}),$(Bo.Dropdown,{children:r.map(n=>{let s=n===t;return $(Bo.Item,{sx:[{height:rr[o]},p=>({"&&":{color:s?p.white:void 0},background:s?p.colors[l||p.primaryColor][6]:void 0})],disabled:s,onClick:()=>f(n),children:$(er,{size:o,children:n})},n)})})]})]})}import{jsx as fe,jsxs as Ct}from"react/jsx-runtime";var gt=It((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}})),tr=it(function({className:e,style:r,topBorderColor:t,fetching:f,page:l,onPageChange:n,paginationColor:s,paginationSize:p,loadingText:x,noRecordsText:c,paginationText:u,totalRecords:I,recordsPerPage:m,onRecordsPerPageChange:S,recordsPerPageLabel:g,recordsPerPageOptions:h,recordsLength:C,horizontalSpacing:k,paginationWrapBreakpoint:R,getPaginationControlProps:v},w){let F;if(f)F=x;else if(!I)F=c;else{let L=(l-1)*m+1,W=L+C-1;F=u({from:L,to:W,totalRecords:I})}let{classes:T,cx:A}=gt({topBorderColor:t,paginationWrapBreakpoint:R});return Ct(pt,{ref:w,px:k??"xs",py:"xs",className:A(T.root,e),style:r,children:[fe(xt,{className:T.text,size:p,children:F}),h&&fe(te,{size:p,label:g,values:h,color:s,value:m,onChange:S}),fe(mt,{color:s,className:A(T.pagination,{[T.paginationFetching]:f||!C}),value:l,onChange:n,size:p,total:Math.ceil(I/m),getControlProps:v})]})});a();import{Box as Ot,createStyles as vt}from"@mantine/core";a();import{Box as St,createStyles as ht}from"@mantine/core";import{jsx as Bt}from"react/jsx-runtime";var bt=ht({withPointerCursor:{cursor:"pointer"},noWrap:{whiteSpace:"nowrap"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis"}});function ne({className:o,sx:e,style:r,visibleMediaQuery:t,record:f,recordIndex:l,onClick:n,noWrap:s,ellipsis:p,textAlignment:x,width:c,accessor:u,render:I,defaultRender:m,customCellAttributes:S}){let{cx:g,classes:h}=bt();return K(t)?Bt(St,{component:"td",className:g({[h.noWrap]:s||p,[h.ellipsis]:p,[h.withPointerCursor]:n},o),sx:[{width:c,minWidth:c,maxWidth:c,textAlign:x},e],style:r,onClick:n,...S?.(f,l),children:I?I(f,l):m?m(f,l,u):D(f,u)}):null}a();import{Collapse as Dt,createStyles as yt}from"@mantine/core";a();import{useTimeout as fr}from"@mantine/hooks";import{useEffect as le,useState as fo}from"react";function nr(o){let[e,r]=fo(null),t=o?.join(":")||"";return le(()=>{r(null)},[t]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function lr(o){let[e,r]=fo(null);return le(()=>{o&&r(null)},[o]),{rowContextMenuInfo:e,setRowContextMenuInfo:r}}function dr({rowExpansion:o,records:e,idAccessor:r}){let t=[];if(o&&e){let{trigger:s,allowMultiple:p,initiallyExpanded:x}=o;e&&s==="always"?t=e.map(c=>D(c,r)):x&&(t=e.filter(x).map(c=>D(c,r)),p||(t=[t[0]]))}let f,l,n=fo(t);if(o){let{trigger:s,allowMultiple:p,collapseProps:x,content:c}=o;o.expanded?{recordIds:f,onRecordIdsChange:l}=o.expanded:[f,l]=n;let u=I=>l?.(f.filter(m=>m!==D(I,r)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:I=>s==="always"?!0:f.includes(D(I,r)),expandRow:I=>{let m=D(I,r);l?.(p?[...f,m]:[m])},collapseRow:u,collapseProps:x,content:(I,m)=>()=>c({record:I,recordIndex:m,collapse:()=>u(I)})}}}function sr(o,e){let[r,t]=fo(o),[f,l]=fo(o),n=fr(()=>t(!0),0),s=fr(()=>l(!1),e||200);return le(()=>{o?(s.clear(),l(!0),n.start()):(n.clear(),t(!1),s.start())},[n,s,o]),{expanded:r,visible:f}}import{Fragment as Tt,jsx as Do,jsxs as Pt}from"react/jsx-runtime";var wt=yt({cell:{"&&":{borderBottomWidth:0,padding:0}},expandedCell:{"&&":{borderBottomWidth:1}}});function de({open:o,colSpan:e,content:r,collapseProps:t}){let{expanded:f,visible:l}=sr(o,t?.transitionDuration),{cx:n,classes:s}=wt();return l?Pt(Tt,{children:[Do("tr",{}),Do("tr",{children:Do("td",{className:n(s.cell,{[s.expandedCell]:f}),colSpan:e,children:Do(Dt,{in:f,...t,children:r()})})})]}):null}a();import{Checkbox as Rt,createStyles as kt,px as Ft}from"@mantine/core";import{jsx as cr}from"react/jsx-runtime";var Mt=kt(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:-Ft(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 se({record:o,recordIndex:e,withRightShadow:r,getCheckboxProps:t,...f}){let{cx:l,classes:n}=Mt();return cr("td",{className:l(n.root,{[n.withRightShadow]:r}),onClick:s=>s.stopPropagation(),children:cr(Rt,{classNames:{input:n.checkbox},...f,...t(o,e)})})}import{Fragment as Lt,jsx as ce,jsxs as ur}from"react/jsx-runtime";var At=vt(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 ue({record:o,recordIndex:e,columns:r,defaultColumnRender:t,selectionVisible:f,selectionChecked:l,onSelectionChange:n,isRecordSelectable:s,getSelectionCheckboxProps:p,onClick:x,onCellClick:c,onContextMenu:u,expansion:I,customRowAttributes:m,className:S,style:g,sx:h,contextMenuVisible:C,leftShadowVisible:k}){let{cx:R,classes:v}=At();return ur(Lt,{children:[ur(Ot,{component:"tr",className:R({[v.withPointerCursor]:x||I?.expandOnClick,[v.selected]:l,[v.contextMenuVisible]:C},typeof S=="function"?S(o,e):S),onClick:w=>{if(I){let{isRowExpanded:F,expandOnClick:T,expandRow:A,collapseRow:L}=I;T&&(F(o)?L(o):A(o))}x?.(w)},style:typeof g=="function"?g(o,e):g,sx:h,...m?.(o,e),onContextMenu:u,children:[f&&ce(se,{record:o,recordIndex:e,withRightShadow:k,checked:l,disabled:!n||(s?!s(o,e):!1),onChange:n,getCheckboxProps:p}),r.map((w,F)=>{let{accessor:T,hidden:A,visibleMediaQuery:L,textAlignment:W,noWrap:Y,ellipsis:To,width:Po,render:Ro,cellsClassName:_,cellsStyle:j,cellsSx:ko,customCellAttributes:Fo}=w,lo;return c&&(lo=Mo=>c({event:Mo,record:o,recordIndex:e,column:w,columnIndex:F})),A?null:ce(ne,{className:typeof _=="function"?_(o,e):_,style:typeof j=="function"?j(o,e):j,sx:ko,visibleMediaQuery:L,record:o,recordIndex:e,onClick:lo,accessor:T,textAlignment:W,noWrap:Y,ellipsis:To,width:Po,render:Ro,defaultRender:t,customCellAttributes:Fo},T)})]}),I&&ce(de,{colSpan:r.filter(w=>!w.hidden).length+(f?1:0),open:I.isRowExpanded(o),content:I.content(o,e),collapseProps:I.collapseProps})]})}a();import{createStyles as Ht,Paper as Et,px as Nt}from"@mantine/core";import{useClickOutside as qt,useElementSize as Wt,useMergedRef as zt,useWindowEvent as pr}from"@mantine/hooks";import{jsx as Vt}from"react/jsx-runtime";var Ut=Ht(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 pe({borderRadius:o="xs",shadow:e="sm",zIndex:r=3,y:t,x:f,onDestroy:l,children:n}){pr("resize",l),pr("scroll",l);let s=qt(l),{ref:p,width:x,height:c}=Wt(),u=zt(s,p),{innerWidth:I,innerHeight:m}=window,{classes:S,theme:{dir:g,spacing:h}}=Ut(),C=Nt(h.md);return Vt(Et,{ref:u,shadow:e,radius:o,className:S.root,sx:{zIndex:r,top:t+c+C>m?m-c-C:t,left:g==="ltr"?f+x+C>I?I-x-C:f:I-C-(f-x-C<0?x+C:f)},children:n})}a();import{createStyles as Gt}from"@mantine/core";import{jsx as Qt}from"react/jsx-runtime";var Xt=Gt(o=>({root:{height:1,background:o.colorScheme==="dark"?o.colors.dark[5]:o.colors.gray[1]}}));function me(){let{classes:o}=Xt();return Qt("div",{className:o.root})}a();import{Box as Zt,Text as Kt,UnstyledButton as $t,createStyles as Yt,px as _t}from"@mantine/core";import{jsx as mr,jsxs as Jt}from"react/jsx-runtime";var jt=Yt((o,{color:e})=>{let r=_t(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 xe({icon:o,title:e,color:r,disabled:t,onClick:f}){let{classes:l}=jt({color:r});return Jt($t,{className:l.root,disabled:t,onClick:f,children:[o&&mr(Zt,{className:l.icon,children:o}),mr(Kt,{className:l.title,size:"sm",children:e})]})}a();import{Box as xr,createStyles as of,ScrollArea as ef}from"@mantine/core";import{jsx as yo,jsxs as af}from"react/jsx-runtime";var rf=of(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,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,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 Ie({topShadowVisible:o,leftShadowVisible:e,rightShadowVisible:r,bottomShadowVisible:t,headerHeight:f,footerHeight:l,onScrollPositionChange:n,children:s,viewportRef:p}){let x=l?l-1:0,{cx:c,classes:u}=rf();return af(ef,{viewportRef:p,classNames:{root:u.root,scrollbar:u.scrollbar,thumb:u.thumb,corner:u.corner},styles:{scrollbar:{marginTop:f,marginBottom:x}},onScrollPositionChange:n,children:[s,yo(xr,{className:c(u.shadow,u.topShadow,{[u.shadowVisible]:o}),sx:{top:f}}),yo("div",{className:c(u.shadow,u.leftShadow,{[u.shadowVisible]:e})}),yo("div",{className:c(u.shadow,u.rightShadow,{[u.shadowVisible]:r})}),yo(xr,{className:c(u.shadow,u.bottomShadow,{[u.shadowVisible]:t}),sx:{bottom:x}})]})}import{jsx as O,jsxs as ir}from"react/jsx-runtime";var Ir={},sf=ff((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 gr({withBorder:o,borderRadius:e,borderColor:r=B=>B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],rowBorderColor:t=B=>B.fn.rgba(B.colorScheme==="dark"?B.colors.dark[4]:B.colors.gray[3],.65),withColumnBorders:f,textSelectionDisabled:l,height:n="100%",minHeight:s,shadow:p,verticalAlignment:x="center",fetching:c,columns:u,defaultColumnRender:I,idAccessor:m="id",records:S,selectedRecords:g,onSelectedRecordsChange:h,isRecordSelectable:C,allRecordsSelectionCheckboxProps:k={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:R=(B,z)=>({"aria-label":`Select record ${z+1}`}),sortStatus:v,sortIcons:w,onSortStatusChange:F,horizontalSpacing:T,page:A,onPageChange:L,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:To,recordsPerPageOptions:Po,recordsPerPageLabel:Ro="Records per page",paginationColor:_,paginationSize:j="sm",paginationText:ko=({from:B,to:z,totalRecords:U})=>`${B} - ${z} / ${U}`,paginationWrapBreakpoint:Fo="sm",getPaginationControlProps:lo=B=>B==="previous"?{"aria-label":"Previous page"}:B==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:Mo,customLoader:Cr,loaderSize:Sr,loaderVariant:hr,loaderColor:br,loadingText:Br="...",emptyState:Dr,noRecordsText:ge="No records",noRecordsIcon:yr,striped:wr,noHeader:Tr,onRowClick:Oo,onCellClick:Pr,onScrollToTop:Ce,onScrollToBottom:Se,onScrollToLeft:he,onScrollToRight:be,rowContextMenu:H,rowExpansion:Rr,rowClassName:kr,rowStyle:Fr,rowSx:Mr,customRowAttributes:Or,scrollViewportRef:vr,bodyRef:Ar,m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr,sx:Ur,className:Vr,classNames:so,style:Gr,styles:vo,...Xr}){let{ref:B,width:z,height:U}=no(),{ref:Qr,height:Ao}=no(),{ref:Zr,width:Lo,height:J}=no(),{ref:Kr,height:$r}=no(),{ref:Yr,height:Be}=no(),[Ho,De]=wo(!0),[Eo,ye]=wo(!0),[co,we]=wo(!0),[No,Te]=wo(!0),{rowContextMenuInfo:V,setRowContextMenuInfo:Q}=lr(c),_r=dr({rowExpansion:Rr,records:S,idAccessor:m}),qo=ie(()=>{if(!c&&H&&Q(null),c||J<=U)De(!0),ye(!0);else{let i=B.current.scrollTop,b=i===0,P=J-i-U<1;De(b),ye(P),b&&b!==Ho&&Ce?.(),P&&P!==Eo&&Se?.()}if(c||Lo===z)we(!0),Te(!0);else{let i=B.current.scrollLeft,b=i===0,P=Lo-i-z<1;we(b),Te(P),b&&b!==co&&he?.(),P&&P!==No&&be?.()}},[c,Se,he,be,Ce,H,U,B,z,Eo,co,No,Ho,Q,J,Lo]);Ze(qo,[qo]);let jr=ie(i=>{B.current.scrollTo({top:0,left:0}),L(i)},[L,B]),uo=S?.length,Pe=S?.map(i=>D(i,m)),po=!!g,oo=g?.map(i=>D(i,m)),Re=Pe!==void 0&&oo!==void 0&&oo.length>0,Wo=C?S?.filter(C):S,mo=Wo?.map(i=>D(i,m)),xo=Re&&mo.every(i=>oo.includes(i)),Jr=Re&&mo.some(i=>oo.includes(i)),oa=ie(()=>{h?.(xo?g.filter(i=>!mo.includes(D(i,m))):to([...g,...Wo],i=>D(i,m)))},[xo,m,h,mo,Wo,g]),{lastSelectionChangeIndex:Io,setLastSelectionChangeIndex:ea}=nr(Pe),zo=po&&!co,{cx:ke,classes:E,theme:ra}=sf({borderColor:r,rowBorderColor:t}),aa={m:Lr,my:Hr,mx:Er,mt:Nr,mb:qr,ml:Wr,mr:zr},io=typeof vo=="function"?vo(ra,Ir,Ir):vo;return ir(tf,{...aa,className:ke(E.root,{[E.tableWithBorder]:o},Vr,so?.root),sx:[i=>({borderRadius:i.radius[e]||e,boxShadow:i.shadows[p]||p,height:n,minHeight:s}),...nf(Ur)],style:{...io?.root,...Gr},children:[O(Ie,{viewportRef:df(B,vr||null),topShadowVisible:!Ho,leftShadowVisible:!(g||co),rightShadowVisible:!No,bottomShadowVisible:!Eo,headerHeight:Ao,footerHeight:$r,onScrollPositionChange:qo,children:ir(lf,{ref:Zr,horizontalSpacing:T,className:ke(E.table,{[E.tableWithColumnBorders]:f,[E.lastRowBorderBottomVisible]:J<U,[E.textSelectionDisabled]:l,[E.verticalAlignmentTop]:x==="top",[E.verticalAlignmentBottom]:x==="bottom"}),striped:uo?wr:!1,...Xr,children:[Tr?null:O(Je,{ref:Qr,className:so?.header,style:io?.header,columns:u,sortStatus:v,sortIcons:w,onSortStatusChange:F,selectionVisible:po,selectionChecked:xo,selectionIndeterminate:Jr&&!xo,onSelectionChange:oa,selectionCheckboxProps:k,leftShadowVisible:zo}),O("tbody",{ref:Ar,children:uo?S.map((i,b)=>{let P=D(i,m),eo=oo?.includes(P)||!1,go=!1,Co=!1;if(H){let{hidden:y}=H;(!y||!(typeof y=="function"?y(i,b):y))&&(H.trigger==="click"?go=!0:Co=!0)}let So;h&&(So=y=>{if(y.nativeEvent.shiftKey&&Io!==null){let Z=S.filter(b>Io?(G,X)=>X>=Io&&X<=b&&(C?C(G,X):!0):(G,X)=>X>=b&&X<=Io&&(C?C(G,X):!0));h(eo?$o(g,Z,G=>D(G,m)):to([...g,...Z],G=>D(G,m)))}else h(eo?g.filter(Z=>D(Z,m)!==P):to([...g,i],Z=>D(Z,m)));ea(b)});let ro;go?ro=y=>{Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b}),Oo?.(i,b,y)}:Oo&&(ro=y=>{Oo(i,b,y)});let Fe;return Co&&(Fe=y=>{y.preventDefault(),Q({y:y.clientY,x:y.clientX,record:i,recordIndex:b})}),O(ue,{record:i,recordIndex:b,columns:u,defaultColumnRender:I,selectionVisible:po,selectionChecked:eo,onSelectionChange:So,isRecordSelectable:C,getSelectionCheckboxProps:R,onClick:ro,onCellClick:Pr,onContextMenu:Fe,contextMenuVisible:V?D(V.record,m)===P:!1,expansion:_r,className:kr,style:Fr,sx:Mr,customRowAttributes:Or,leftShadowVisible:zo},P)}):O(Vo,{})}),u.some(i=>i.footer)&&O(Ke,{ref:Kr,className:so?.footer,style:io?.footer,borderColor:r,columns:u,selectionVisible:po,leftShadowVisible:zo,scrollDiff:J-U})]})}),A&&O(tr,{ref:Yr,className:so?.pagination,style:io?.pagination,topBorderColor:r,horizontalSpacing:T,fetching:c,page:A,onPageChange:jr,totalRecords:W,recordsPerPage:Y,onRecordsPerPageChange:To,recordsPerPageOptions:Po,recordsPerPageLabel:Ro,paginationColor:_,paginationSize:j,paginationText:ko,paginationWrapBreakpoint:Fo,getPaginationControlProps:lo,noRecordsText:ge,loadingText:Br,recordsLength:uo}),O(ae,{pt:Ao,pb:Be,fetching:c,backgroundBlur:Mo,customContent:Cr,size:Sr,variant:hr,color:br}),O(Ko,{pt:Ao,pb:Be,icon:yr,text:ge,active:!c&&!uo,children:Dr}),H&&V&&O(pe,{zIndex:H.zIndex,borderRadius:H.borderRadius,shadow:H.shadow,y:V.y,x:V.x,onDestroy:()=>Q(null),children:H.items(V.record,V.recordIndex).map(({divider:i,key:b,title:P,icon:eo,color:go,hidden:Co,disabled:So,onClick:ro})=>i?O(me,{},b):Co?null:O(xe,{title:P??ao(b),icon:eo,color:go,disabled:So,onClick:()=>{Q(null),ro()}},b))})]})}a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();a();export{gr as DataTable,$o as differenceBy,D as getValueAtPath,ao as humanize,to as uniqBy};
2
2
  //# sourceMappingURL=index.mjs.map