mantine-datatable 2.4.8 → 2.4.10

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