mantine-datatable 2.9.2 → 2.9.3

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