mantine-datatable 2.6.0 → 2.6.1

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