mantine-datatable
Advanced tools
Comparing version 7.12.3 to 7.12.4
@@ -1,2 +0,2 @@ | ||
"use strict";"use client";var _n=Object.create;var st=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var Gn=Object.getPrototypeOf,Xn=Object.prototype.hasOwnProperty;var Qn=(e,t)=>{for(var o in t)st(e,o,{get:t[o],enumerable:!0})},so=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Bn(t))!Xn.call(e,a)&&a!==o&&st(e,a,{get:()=>t[a],enumerable:!(n=Fn(t,a))||n.enumerable});return e};var V=(e,t,o)=>(o=e!=null?_n(Gn(e)):{},so(t||!e||!e.__esModule?st(o,"default",{value:e,enumerable:!0}):o,e)),Un=e=>so(st({},"__esModule",{value:!0}),e);var qn={};Qn(qn,{DataTable:()=>Ma,DataTableDraggableRow:()=>Xt,differenceBy:()=>Wt,getRecordId:()=>L,getValueAtPath:()=>pt,humanize:()=>he,reorderRecords:()=>Jn,swapRecords:()=>Zn,uniqBy:()=>Ze,useDataTableColumns:()=>It});module.exports=Un(qn);var wt=require("@mantine/core"),ot=require("@mantine/hooks"),Gt=V(require("clsx")),B=require("react");var Nt=require("react");var co=require("@mantine/core"),[uo,ve]=(0,co.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var mo=require("react/jsx-runtime"),Lt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:r,resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d}=e,[u,b]=(0,Nt.useState)(""),[m,T]=(0,Nt.useState)("");return(0,mo.jsx)(uo,{value:{sourceColumn:u,setSourceColumn:b,targetColumn:m,setTargetColumn:T,columnsToggle:a,setColumnsToggle:r,swapColumns:()=>{if(!o||!n||!u||!m)return;let x=o.indexOf(u),D=o.indexOf(m);if(x!==-1&&D!==-1){let S=o.splice(x,1)[0];o.splice(D,0,S),n([...o])}},resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d},children:t})};var Ht=require("react/jsx-runtime");function po(){return(0,Ht.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Ht.jsx)("td",{})})}var dt=require("@mantine/core");var ae=require("react/jsx-runtime");function fo(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("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"}),(0,ae.jsx)("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"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function bo({icon:e,text:t,pt:o,pb:n,active:a,children:r}){return(0,ee.jsx)(dt.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:r||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(fo,{})}),(0,ee.jsx)(dt.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Wo=V(require("clsx")),Ao=require("react");var ko=require("@mantine/core"),Eo=V(require("clsx"));var ct=require("@mantine/hooks"),To=require("react"),It=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c)&&f.push(c)}),y.forEach(c=>{f.includes(c.accessor)||f.push(c.accessor)}),f}function a(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c.accessor)&&f.push(c)}),y.forEach(c=>{f.find(w=>w.accessor===c.accessor)||f.push({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})}),f}function r(p,y){let f=[];return p.forEach(c=>{let w=Object.keys(c)[0];y.find(h=>h.accessor===w)&&f.push(c)}),y.forEach(c=>{let w=c.accessor;if(!f.find(h=>Object.keys(h)[0]===w)){let h={};h[w]="",f.push(h)}}),f}function l(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-order`:"",defaultValue:e?d:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=n(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[c,f]}function i(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-toggle`:"",defaultValue:e?b:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=a(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[a(p,t),f]}function s(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-width`:"",defaultValue:e?u:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=r(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[r(p,t),f]}let d=t&&t.map(p=>p.accessor)||[],u=t&&t.map(p=>({[p.accessor]:p.width??"initial"}))||[],b=t&&t.map(p=>({accessor:p.accessor,defaultToggle:p.defaultToggle||!0,toggleable:p.toggleable,toggled:p.defaultToggle===void 0?!0:p.defaultToggle})),[m,T]=l(),[g,x]=i(),[D,S]=s(),M=()=>T(d),P=()=>{x(b)},N=()=>S(u);return{effectiveColumns:(0,To.useMemo)(()=>m?m.map(f=>t.find(c=>c.accessor===f)).map(f=>({...f,hidden:!g.find(c=>c.accessor===f?.accessor)?.toggled})).map(f=>({...f,width:D.find(c=>c[f?.accessor])?.[f?.accessor]})):t,[t,m,g,D]),setColumnsOrder:T,columnsOrder:m,resetColumnsOrder:M,columnsToggle:g,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:D,setColumnsWidth:S,setColumnWidth:(p,y)=>{let f=D.map(c=>c[p]?{[p]:y}:c);S(f)},resetColumnsWidth:N}};var go=require("@mantine/hooks");function ge(){let[e]=(0,go.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var ut=require("react"),ho=typeof window<"u"?ut.useLayoutEffect:ut.useEffect;var mt=require("react");function Co(e){let[t,o]=(0,mt.useState)(null),n=e?.join(":")||"";return(0,mt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Re=require("react");function $n(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function Kn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function Do(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Re.useState)(o?t:Kn(e,t)),r=(0,Re.useRef)();return(0,Re.useEffect)(()=>{if("matchMedia"in window)return r.current=e.map(l=>window.matchMedia(l)),a(r.current.map(l=>l.matches)),$n(r.current,l=>{a(l)})},[e]),n}var yo=require("@mantine/core"),Ot=require("react");function wo(e){let t=(0,yo.useMantineTheme)(),o=(0,Ot.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Ot.useMemo)(()=>e.map(()=>!0),[e]);return Do(o,n)}var So=require("@mantine/core"),xo=require("@mantine/hooks");function ne(e){let t=(0,So.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,xo.useMediaQuery)(o||"",!0)}var Po=require("react");function he(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function Wt(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Ze(e,t){return e.filter((o,n,a)=>n===a.findIndex(r=>t(o)===t(r)))}function pt(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function L(e,t){return typeof t=="string"?pt(e,t):t(e)}function Jn(e,t){let o=structuredClone(t),n=o[e.source.index];return e.destination&&(o.splice(e.source.index,1),o.splice(e.destination.index,0,n)),o}function Zn(e,t){let o=structuredClone(t),n=e.destination;if(!n)return o;let a=o[e.source.index],r=o[n.index];return o.splice(n.index,1,a),o.splice(e.source.index,1,r),o}function vo({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:s,initiallyExpanded:d}=e;t&&i==="always"?n=t.map(u=>L(u,o)):d&&(n=t.filter((u,b)=>d({record:u,index:b})).map(u=>L(u,o)),s||(n=[n[0]]))}let a,r,l=(0,Po.useState)(n);if(e){let{expandable:i,trigger:s,allowMultiple:d,collapseProps:u,content:b}=e;e.expanded?{recordIds:a,onRecordIdsChange:r}=e.expanded:[a,r]=l;let m=T=>r?.(a.filter(g=>g!==L(T,o)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:T=>s==="always"?!0:a.includes(L(T,o)),isExpandable:({record:T,index:g})=>i?i({record:T,index:g}):!0,expandRow:T=>{let g=L(T,o);r?.(d?[...a,g]:[g])},collapseRow:m,collapseProps:u,content:({record:T,index:g})=>()=>b({record:T,index:g,collapse:()=>m(T)})}}}var At=require("@mantine/hooks"),Ye=require("react");function Ro(e,t){let[o,n]=(0,Ye.useState)(e),[a,r]=(0,Ye.useState)(e),l=(0,At.useTimeout)(()=>n(!0),0),i=(0,At.useTimeout)(()=>r(!1),t||200);return(0,Ye.useEffect)(()=>{e?(i.clear(),r(!0),l.start()):(l.clear(),n(!1),i.start())},[l,i,e]),{expanded:o,visible:a}}var Me="mantine-datatable-nowrap",ke="mantine-datatable-ellipsis",Z="mantine-datatable-pointer-cursor",ft="mantine-datatable-context-menu-cursor",Mo="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var Lo=require("react/jsx-runtime");function No({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:r,textAlign:l,width:i}){return ne(o)?(0,Lo.jsx)(ko.TableTh,{className:(0,Eo.default)({[Me]:a||r,[ke]:r,[re]:l==="left",[le]:l==="center",[ie]:l==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var Ho=require("@mantine/core"),Oo=require("react/jsx-runtime");function Io({shadowVisible:e}){return(0,Oo.jsx)(Ho.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),zo=(0,Ao.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:r,selectorCellShadowVisible:l,scrollDiff:i},s){let d=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:s,className:(0,Wo.default)("mantine-datatable-footer",t),style:[{position:d?"relative":"sticky",bottom:(0,Ne.rem)(d?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[r&&(0,Ee.jsx)(Io,{shadowVisible:l}),n.map(({hidden:u,...b})=>{if(u)return null;let{accessor:m,visibleMediaQuery:T,textAlign:g,width:x,footer:D,footerClassName:S,footerStyle:M,noWrap:P,ellipsis:N}={...a,...b};return(0,Ee.jsx)(No,{className:S,style:M,visibleMediaQuery:T,textAlign:g,width:x,title:D,noWrap:P,ellipsis:N},m)})]})})});var H=require("@mantine/core"),na=V(require("clsx")),ht=require("react");var Vo=require("@mantine/core"),_o=V(require("clsx")),zt=require("react");var Bo=require("react/jsx-runtime");function Fo({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:r}}){let l=(0,zt.useMemo)(()=>t.map(({visibleMediaQuery:d})=>d),[t]),i=wo(l),s=(0,zt.useMemo)(()=>t.filter(({hidden:d},u)=>!d&&i?.[u]).length,[t,i]);return s>0?(0,Bo.jsx)(Vo.TableTh,{colSpan:s,className:(0,_o.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:r,children:o??he(e)}):null}var I=require("@mantine/core"),et=V(require("clsx")),Tt=require("react");var se=require("@mantine/core"),Qo=require("@mantine/hooks");var qe=require("react/jsx-runtime");function Go(){return(0,qe.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,qe.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,qe.jsx)("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"})]})}var je=require("react/jsx-runtime");function Xo(){return(0,je.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,je.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,je.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var Ce=require("react/jsx-runtime");function Uo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Qo.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:l=>{l.preventDefault(),a()},children:(0,Ce.jsx)(t?Xo:Go,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:l=>l.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var $o=require("@mantine/core"),bt=require("react");var Jo=require("react/jsx-runtime"),Ko=e=>{let{accessor:t,columnRef:o}=e,n=(0,bt.useRef)(null),[a,r]=(0,bt.useState)(0),{setColumnWidth:l}=ve(),i=b=>{b.preventDefault(),b.stopPropagation(),document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),document.body.style.cursor="col-resize"},s=b=>{if(!o.current)return;let m=b.clientX-o.current.getBoundingClientRect().right,g=`${o.current.getBoundingClientRect().width+m}px`;o.current.style.width=g,l(t,o.current.style.width),r(-m)},d=()=>{o.current&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),document.body.style.cursor="initial",l(t,o.current.style.width),r(0))};return(0,Jo.jsx)("div",{ref:n,onClick:b=>b.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",l(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,$o.rem)(a)}})};var De=require("react/jsx-runtime");function Zo(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M12 5l0 14"}),(0,De.jsx)("path",{d:"M16 9l-4 -4"}),(0,De.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function Yo(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var Y=require("react/jsx-runtime");function qo(){return(0,Y.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Y.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var v=require("react/jsx-runtime");function ea({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:r,draggable:l,toggleable:i,resizable:s,sortIcons:d,textAlign:u,width:b,sortStatus:m,onSortStatusChange:T,filter:g,filtering:x,sortKey:D}){let{setSourceColumn:S,setTargetColumn:M,swapColumns:P,setColumnsToggle:N}=ve(),[W,A]=(0,Tt.useState)(!1),p=(0,Tt.useRef)(null);if(!ne(n))return null;let y=a??he(o),f=typeof y=="string"?y:void 0,c=r&&T?k=>{k?.defaultPrevented||T({sortKey:D,columnAccessor:o,direction:m?.columnAccessor===o?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,w=k=>{k.stopPropagation(),S(o),A(!1)},h=k=>{k.preventDefault(),M(o),A(!0)},z=()=>{M(o),A(!1),P()},F=()=>{A(!0)},X=()=>{A(!1)},te=k=>{k.stopPropagation(),N(j=>j.map(J=>J.accessor===o?{...J,toggled:!1}:J))};return(0,v.jsxs)(I.TableTh,{className:(0,et.default)({"mantine-datatable-header-cell-sortable":r,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":s},e),style:[{width:b,...s?{minWidth:"1px"}:{minWidth:b,maxWidth:b}},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:c,onKeyDown:k=>k.key==="Enter"&&c?.(),ref:p,children:[(0,v.jsxs)(I.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,v.jsxs)(I.Flex,{align:"center",w:"100%",className:(0,et.default)({"mantine-datatable-header-cell-draggable":l,"mantine-datatable-header-cell-drag-over":W}),draggable:l,onDragStart:l?w:void 0,onDragEnter:l?F:void 0,onDragOver:l?h:void 0,onDrop:l?z:void 0,onDragLeave:l?X:void 0,children:[l?(0,v.jsx)(I.Center,{role:"img","aria-label":"Drag column",children:(0,v.jsx)(I.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:k=>{k.stopPropagation()},children:(0,v.jsx)(qo,{})})}):null,(0,v.jsx)(I.Box,{className:(0,et.default)("mantine-datatable-header-cell-sortable-text",{[re]:u==="left",[le]:u==="center",[ie]:u==="right"},Me,ke),title:f,children:y})]}),i?(0,v.jsx)(I.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,v.jsx)(I.ActionIcon,{size:"xs",variant:"light",onClick:te,children:(0,v.jsx)(jo,{})})}):null,r||m?.columnAccessor===o?(0,v.jsx)(v.Fragment,{children:m?.columnAccessor===o?(0,v.jsx)(I.Center,{className:(0,et.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||(0,v.jsx)(Zo,{})}):(0,v.jsx)(I.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:d?.unsorted||(0,v.jsx)(Yo,{})})}):null,g?(0,v.jsx)(Uo,{isActive:!!x,children:g}):null]}),s?(0,v.jsx)(Ko,{accessor:o,columnRef:p}):null]})}var gt=require("@mantine/core"),ta=V(require("clsx")),oa=require("react");var Vt=require("react/jsx-runtime"),aa=(0,oa.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:r,indeterminate:l,checkboxProps:i,onChange:s,rowSpan:d},u){let b=!i.disabled;return(0,Vt.jsx)(gt.TableTh,{ref:u,className:(0,ta.default)("mantine-datatable-header-selector-cell",{[Z]:n==="cell"&&b},t),style:o,rowSpan:d,"data-shadow-visible":a||void 0,onClick:n==="cell"&&b?s:void 0,children:(0,Vt.jsx)(gt.Checkbox,{classNames:b?{input:Z}:void 0,checked:r,indeterminate:l,onChange:s,...i,disabled:!(s||i.onChange)||i.disabled})})});var _=require("react/jsx-runtime"),ra=(0,ht.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:r,onSortStatusChange:l,columns:i,defaultColumnProps:s,groups:d,selectionTrigger:u,selectionVisible:b,selectionChecked:m,selectionIndeterminate:T,onSelectionChange:g,selectionCheckboxProps:x,selectorCellShadowVisible:D,selectionColumnClassName:S,selectionColumnStyle:M},P){let N=b?(0,_.jsx)(aa,{ref:t,className:S,style:M,trigger:u,shadowVisible:D,checked:m,indeterminate:T,checkboxProps:x,onChange:g,rowSpan:d?2:void 0}):null,{columnsToggle:W,setColumnsToggle:A}=ve(),[p,y]=(0,ht.useState)(!1),f=i.some(h=>h.toggleable),c=f?Object.fromEntries(i.map(({accessor:h,title:z})=>[h,z??he(String(h))])):void 0,w=(0,_.jsxs)(H.TableThead,{className:(0,na.default)("mantine-datatable-header",o),style:n,ref:P,onContextMenu:f?h=>{h.preventDefault(),y(z=>!z)}:void 0,children:[d&&(0,_.jsxs)(H.TableTr,{children:[N,d.map(h=>(0,_.jsx)(Fo,{group:h},h.id))]}),(0,_.jsxs)(H.TableTr,{children:[!d&&N,i.map(({hidden:h,...z},F)=>{if(h)return null;let{accessor:X,visibleMediaQuery:te,textAlign:k,width:j,title:J,sortable:We,draggable:Ae,toggleable:ze,resizable:Ve,titleClassName:_e,titleStyle:Fe,filter:ue,filtering:Be,sortKey:Ge}={...s,...z};return(0,_.jsx)(ea,{accessor:X,className:_e,style:Fe,visibleMediaQuery:te,textAlign:k,width:j,title:J,sortable:We,draggable:Ae,toggleable:ze,resizable:Ve&&F<i.length-1,sortStatus:a,sortIcons:r,sortKey:Ge,onSortStatusChange:l,filter:ue,filtering:Be},X)})]})]});return f?(0,_.jsxs)(H.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:p,onChange:y,children:[(0,_.jsx)(H.PopoverTarget,{children:w}),(0,_.jsx)(H.PopoverDropdown,{children:(0,_.jsx)(H.Stack,{children:W.filter(h=>h.toggleable).map(h=>(0,_.jsx)(H.Group,{children:(0,_.jsx)(H.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:c[h.accessor],checked:h.toggled,onChange:z=>{A(W.map(F=>F.accessor===h.accessor?{...F,toggled:z.currentTarget.checked}:F))}})},h.accessor))})})]}):w});var Ct=require("@mantine/core"),la=V(require("clsx")),_t=require("react/jsx-runtime");function ia({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:r,type:l,color:i}){return(0,_t.jsx)(Ct.Center,{pt:e,pb:t,className:(0,la.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,_t.jsx)(Ct.Loader,{size:r,type:l,color:i}))})}var de=require("@mantine/core"),Ft=V(require("clsx")),ba=require("react");var R=require("@mantine/core"),pa=V(require("clsx"));var sa=require("@mantine/core");function E(e,t,o){return e?(0,sa.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function da({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:r,highlightOnHoverColor:l}){return{"--mantine-datatable-color-light":E(t,e,"light"),"--mantine-datatable-color-dark":E(t,e,"dark"),"--mantine-datatable-background-color-light":E(o,e,"light"),"--mantine-datatable-background-color-dark":E(o,e,"dark"),"--mantine-datatable-border-color-light":E(n,e,"light"),"--mantine-datatable-border-color-dark":E(n,e,"dark"),"--mantine-datatable-row-border-color-light":E(a,e,"light"),"--mantine-datatable-row-border-color-dark":E(a,e,"dark"),"--mantine-datatable-striped-color-light":E(r,e,"light"),"--mantine-datatable-striped-color-dark":E(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":E(l,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":E(l,e,"dark")}}function Dt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":E(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":E(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":E(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":E(o,e,"dark")}}function ca({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":E(t,e,"light"),"--mantine-datatable-row-color-dark":E(t,e,"dark"),"--mantine-datatable-row-background-color-light":E(o,e,"light"),"--mantine-datatable-row-background-color-dark":E(o,e,"dark")}}var He=require("react/jsx-runtime");function ua(){return(0,He.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,He.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,He.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,He.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var $=require("react/jsx-runtime"),ma={xs:(0,R.rem)(22),sm:(0,R.rem)(26),md:(0,R.rem)(32),lg:(0,R.rem)(38),xl:(0,R.rem)(44)};function fa({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:r,onChange:l}){return(0,$.jsxs)(R.Group,{gap:"xs",children:[(0,$.jsx)(R.Text,{component:"div",size:e,children:t}),(0,$.jsxs)(R.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,$.jsx)(R.MenuTarget,{children:(0,$.jsx)(R.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,$.jsx)(ua,{}),style:[{fontWeight:"normal"},i=>({height:ma[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,$.jsx)(R.MenuDropdown,{children:o.map(i=>{let s=i===n;return(0,$.jsx)(R.MenuItem,{className:(0,pa.default)({"mantine-datatable-page-size-selector-active":s}),style:[{height:ma[e]},s&&(a||r)?d=>Dt({theme:d,paginationActiveTextColor:a,paginationActiveBackgroundColor:r}):void 0],disabled:s,onClick:()=>l(i),children:(0,$.jsx)(R.Text,{component:"div",size:e,children:i})},i)})})]})]})}var Ie=require("react/jsx-runtime"),Ta=(0,ba.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:r,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:s,paginationActiveBackgroundColor:d,paginationSize:u,loadingText:b,noRecordsText:m,paginationText:T,totalRecords:g,recordsPerPage:x,onRecordsPerPageChange:D,recordsPerPageLabel:S,recordsPerPageOptions:M,recordsLength:P,horizontalSpacing:N,paginationWrapBreakpoint:W,getPaginationControlProps:A},p){let y;if(n)y=b;else if(!g)y=m;else{let c=(a-1)*x+1,w=c+P-1;y=T({from:c,to:w,totalRecords:g})}let f=ne(({breakpoints:c})=>`(min-width: ${typeof W=="number"?`${(0,de.rem)(W)}rem`:c[W]||W})`);return(0,Ie.jsxs)(de.Box,{ref:p,px:N??"xs",py:"xs",className:(0,Ft.default)("mantine-datatable-pagination",t),style:[{flexDirection:f?"row":"column"},o],children:[(0,Ie.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:u,children:y}),M&&(0,Ie.jsx)(fa,{activeTextColor:s,activeBackgroundColor:d,size:u,label:S,values:M,value:x,onChange:D}),(0,Ie.jsx)(de.Pagination,{classNames:{root:(0,Ft.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:s||d?c=>Dt({theme:c,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0,withEdges:l,withControls:i,value:a,onChange:r,size:u,total:Math.ceil(g/x),getControlProps:A})]})});var xa=require("@mantine/core"),Pa=V(require("clsx"));var ga=require("@mantine/core"),ha=V(require("clsx"));var Da=require("react/jsx-runtime");function Ca({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:r,onDoubleClick:l,onContextMenu:i,noWrap:s,ellipsis:d,textAlign:u,width:b,accessor:m,render:T,defaultRender:g,customCellAttributes:x}){return ne(o)?(0,Da.jsx)(ga.TableTd,{className:(0,ha.default)({[Me]:s||d,[ke]:d,[Z]:r||l,[ft]:i,[re]:u==="left",[le]:u==="center",[ie]:u==="right"},e),style:[{width:b,minWidth:b,maxWidth:b},t],onClick:r,onDoubleClick:l,onContextMenu:i,...x?.(n,a),children:T?T(n,a):g?g(n,a,m):pt(n,m)}):null}var we=require("@mantine/core");var q=require("react/jsx-runtime");function ya({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:r}=Ro(e,n?.transitionDuration);return r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(we.TableTr,{}),(0,q.jsx)(we.TableTr,{children:(0,q.jsx)(we.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,q.jsx)(we.Collapse,{in:a,...n,children:(0,q.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var yt=require("@mantine/core"),wa=V(require("clsx"));var Bt=require("react/jsx-runtime");function Sa({className:e,style:t,record:o,index:n,trigger:a,onChange:r,withRightShadow:l,checkboxProps:i,getCheckboxProps:s,...d}){let u={...i,...s(o,n)},b=!d.disabled&&!u.disabled,m=T=>{T.stopPropagation(),a==="cell"&&b&&r?.(T)};return(0,Bt.jsx)(yt.TableTd,{className:(0,wa.default)("mantine-datatable-row-selector-cell",{[Z]:a==="cell"&&b},e),style:t,"data-shadow-visible":l||void 0,onClick:m,children:(0,Bt.jsx)(yt.Checkbox,{classNames:b?{input:Z}:void 0,onChange:r,...d,...u})})}var K=require("react/jsx-runtime");function va({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:r,selectionVisible:l,selectionChecked:i,onSelectionChange:s,isRecordSelectable:d,selectionCheckboxProps:u,getSelectionCheckboxProps:b,onClick:m,onDoubleClick:T,onContextMenu:g,onCellClick:x,onCellDoubleClick:D,onCellContextMenu:S,expansion:M,customAttributes:P,color:N,backgroundColor:W,className:A,style:p,selectorCellShadowVisible:y,selectionColumnClassName:f,selectionColumnStyle:c,rowFactory:w}){let h=(0,K.jsxs)(K.Fragment,{children:[l&&(0,K.jsx)(Sa,{className:f,style:c,record:e,index:t,trigger:r,withRightShadow:y,checked:i,disabled:!s||(d?!d(e,t):!1),onChange:s,checkboxProps:u,getCheckboxProps:b}),o.map(({hidden:X,hiddenContent:te,...k},j)=>{if(X||te)return null;let{accessor:J,visibleMediaQuery:We,textAlign:Ae,noWrap:ze,ellipsis:Ve,width:_e,render:Fe,cellsClassName:ue,cellsStyle:Be,customCellAttributes:Ge}={...n,...k};return(0,K.jsx)(Ca,{className:typeof ue=="function"?ue(e,t):ue,style:Be?.(e,t),visibleMediaQuery:We,record:e,index:t,onClick:x?me=>x({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,onDoubleClick:D?me=>D({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,onContextMenu:S?me=>S({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,accessor:J,textAlign:Ae,noWrap:ze,ellipsis:Ve,width:_e,render:Fe,defaultRender:a,customCellAttributes:Ge},J)})]}),z=M&&(0,K.jsx)(ya,{colSpan:o.filter(({hidden:X})=>!X).length+(l?1:0),open:M.isRowExpanded(e),content:M.content({record:e,index:t}),collapseProps:M.collapseProps}),F=Yn({record:e,index:t,selectionChecked:i,onClick:m,onDoubleClick:T,onContextMenu:g,expansion:M,customAttributes:P,color:N,backgroundColor:W,className:A,style:p});return w?w({record:e,index:t,rowProps:F,children:h,expandedElement:z}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(xa.TableTr,{...F,children:h}),z]})}function Yn({record:e,index:t,selectionChecked:o,onClick:n,onDoubleClick:a,onContextMenu:r,expansion:l,customAttributes:i,color:s,backgroundColor:d,className:u,style:b}){return{className:(0,Pa.default)("mantine-datatable-row",{[Z]:n||a||l?.isExpandable({record:e,index:t})&&l?.expandOnClick},{[ft]:r},typeof u=="function"?u(e,t):u),"data-selected":o||void 0,onClick:m=>{if(l){let{isExpandable:T,isRowExpanded:g,expandOnClick:x,expandRow:D,collapseRow:S}=l;T({record:e,index:t})&&x&&(g(e)?S(e):D(e))}n?.({event:m,record:e,index:t})},onDoubleClick:a?m=>a({event:m,record:e,index:t}):void 0,onContextMenu:r?m=>r({event:m,record:e,index:t}):void 0,style:[s||d?m=>{let T=s?.(e,t),g=d?.(e,t);return ca({theme:m,color:T,backgroundColor:g})}:void 0,b?.(e,t)],...i?.(e,t)??{}}}var ce=require("@mantine/core"),tt=V(require("clsx")),Se=require("react/jsx-runtime");function Ra({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:r,headerHeight:l,footerHeight:i,onScrollPositionChange:s,children:d,viewportRef:u,scrollAreaProps:b}){return(0,Se.jsxs)(ce.ScrollArea,{...b,viewportRef:u,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:s,children:[d,(0,Se.jsx)(ce.Box,{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:l?(0,ce.rem)(l):0}}),(0,Se.jsx)("div",{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,Se.jsx)("div",{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,Se.jsx)(ce.Box,{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var O=require("react/jsx-runtime");function Ma({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:r,shadow:l,verticalAlign:i="center",fetching:s,columns:d,storeColumnsKey:u,groups:b,pinFirstColumn:m,pinLastColumn:T,defaultColumnProps:g,defaultColumnRender:x,idAccessor:D="id",records:S,selectionTrigger:M="checkbox",selectedRecords:P,onSelectedRecordsChange:N,selectionColumnClassName:W,selectionColumnStyle:A,isRecordSelectable:p,selectionCheckboxProps:y,allRecordsSelectionCheckboxProps:f={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:c=(G,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:w,sortIcons:h,onSortStatusChange:z,horizontalSpacing:F,page:X,onPageChange:te,totalRecords:k,recordsPerPage:j,onRecordsPerPageChange:J,recordsPerPageOptions:We,recordsPerPageLabel:Ae="Records per page",paginationWithEdges:ze,paginationWithControls:Ve,paginationActiveTextColor:_e,paginationActiveBackgroundColor:Fe,paginationSize:ue="sm",paginationText:Be=({from:G,to:pe,totalRecords:fe})=>`${G} - ${pe} / ${fe}`,paginationWrapBreakpoint:Ge="sm",getPaginationControlProps:me=G=>G==="previous"?{"aria-label":"Previous page"}:G==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:La,customLoader:Ha,loaderSize:Ia,loaderType:Oa,loaderColor:Wa,loadingText:Aa="...",emptyState:za,noRecordsText:Qt="No records",noRecordsIcon:Va,highlightOnHover:_a,striped:Fa,noHeader:Ba,onRowClick:Ga,onRowDoubleClick:Xa,onRowContextMenu:Qa,onCellClick:Ua,onCellDoubleClick:$a,onCellContextMenu:Ka,onScroll:Ut,onScrollToTop:$t,onScrollToBottom:Kt,onScrollToLeft:Jt,onScrollToRight:Zt,c:Ja,backgroundColor:Za,borderColor:Ya,rowBorderColor:qa,stripedColor:ja,highlightOnHoverColor:en,rowColor:tn,rowBackgroundColor:on,rowExpansion:an,rowClassName:nn,rowStyle:rn,customRowAttributes:ln,scrollViewportRef:sn,scrollAreaProps:dn,tableRef:cn,bodyRef:un,m:mn,my:pn,mx:fn,mt:bn,mb:Tn,ml:gn,mr:hn,className:Cn,classNames:Xe,style:Dn,styles:Qe,rowFactory:yn,tableWrapper:St,...Yt}){let{ref:G,width:pe,height:fe}=ge(),Ue=(0,B.useMemo)(()=>b?.flatMap(C=>C.columns)??d,[d,b]),qt=It({key:u,columns:Ue}),{ref:wn,height:xt}=ge(),{ref:Sn,width:Pt,height:$e}=ge(),{ref:xn,height:Pn}=ge(),{ref:vn,height:jt}=ge(),{ref:Rn,width:Mn}=ge(),kn=(0,ot.useMergedRef)(Sn,cn),En=(0,ot.useMergedRef)(G,sn),[vt,eo]=(0,B.useState)(!0),[Rt,to]=(0,B.useState)(!0),[Ke,oo]=(0,B.useState)(!0),[at,ao]=(0,B.useState)(!0),Nn=vo({rowExpansion:an,records:S,idAccessor:D}),Mt=(0,B.useCallback)(()=>{let C=G.current?.scrollTop??0,oe=G.current?.scrollLeft??0;if(s||$e<=fe)eo(!0),to(!0);else{let Q=C===0,U=$e-C-fe<1;eo(Q),to(U),Q&&Q!==vt&&$t?.(),U&&U!==Rt&&Kt?.()}if(s||Pt===pe)oo(!0),ao(!0);else{let Q=oe===0,U=Pt-oe-pe<1;oo(Q),ao(U),Q&&Q!==Ke&&Jt?.(),U&&U!==at&&Zt?.()}},[s,Kt,Jt,Zt,$t,fe,G,pe,Rt,Ke,at,vt,$e,Pt]);ho(Mt,[Mt]);let no=(0,ot.useDebouncedCallback)(Mt,50),Ln=(0,B.useCallback)(C=>{Ut?.(C),no()},[no,Ut]),Hn=(0,B.useCallback)(C=>{G.current?.scrollTo({top:0,left:0}),te(C)},[te,G]),nt=S?.length,ro=S?.map(C=>L(C,D)),xe=!!P,Je=P?.map(C=>L(C,D)),lo=ro!==void 0&&Je!==void 0&&Je.length>0,kt=p?S?.filter(p):S,rt=kt?.map(C=>L(C,D)),lt=lo&&rt.every(C=>Je.includes(C)),In=lo&&rt.some(C=>Je.includes(C)),On=(0,B.useCallback)(()=>{P&&N&&N(lt?P.filter(C=>!rt.includes(L(C,D))):Ze([...P,...kt],C=>L(C,D)))},[lt,D,N,rt,kt,P]),{lastSelectionChangeIndex:it,setLastSelectionChangeIndex:Wn}=Co(ro),Et=xe&&!Ke&&!m,An={m:mn,my:pn,mx:fn,mt:bn,mb:Tn,ml:gn,mr:hn},zn=(0,B.useCallback)(({children:C})=>St?St({children:C}):C,[St]);return(0,O.jsx)(Lt,{...qt,children:(0,O.jsxs)(wt.Box,{...An,className:(0,Gt.default)("mantine-datatable",{"mantine-datatable-with-border":e},Cn,Xe?.root),style:[C=>({...da({theme:C,c:Ja,backgroundColor:Za,borderColor:Ya,rowBorderColor:qa,stripedColor:ja,highlightOnHoverColor:en}),borderRadius:C.radius[t]||t,boxShadow:C.shadows[l]||l,height:n,minHeight:a,maxHeight:r}),Dn,Qe?.root,{position:"relative"}],children:[(0,O.jsx)(Ra,{viewportRef:En,topShadowVisible:!vt,leftShadowVisible:!Ke,leftShadowBehind:xe||!!m,rightShadowVisible:!at,rightShadowBehind:T,bottomShadowVisible:!Rt,headerHeight:xt,footerHeight:Pn,onScrollPositionChange:Ln,scrollAreaProps:dn,children:(0,O.jsx)(zn,{children:(0,O.jsxs)(wt.Table,{ref:kn,horizontalSpacing:F,className:(0,Gt.default)("mantine-datatable-table",{[Mo]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":Yt.withRowBorders&&$e<fe,"mantine-datatable-pin-last-column":T,"mantine-datatable-pin-last-column-scrolled":!at&&T,"mantine-datatable-selection-column-visible":xe,"mantine-datatable-pin-first-column":m,"mantine-datatable-pin-first-column-scrolled":!Ke&&m},Xe?.table),style:{...Qe?.table,"--mantine-datatable-selection-column-width":`${Mn}px`},"data-striped":nt&&Fa||void 0,"data-highlight-on-hover":_a||void 0,...Yt,children:[Ba?null:(0,O.jsx)(Lt,{...qt,children:(0,O.jsx)(ra,{ref:wn,selectionColumnHeaderRef:Rn,className:Xe?.header,style:Qe?.header,columns:Ue,defaultColumnProps:g,groups:b,sortStatus:w,sortIcons:h,onSortStatusChange:z,selectionTrigger:M,selectionVisible:xe,selectionChecked:lt,selectionIndeterminate:In&&!lt,onSelectionChange:On,selectionCheckboxProps:{...y,...f},selectorCellShadowVisible:Et,selectionColumnClassName:W,selectionColumnStyle:A})}),(0,O.jsx)("tbody",{ref:un,children:nt?S.map((C,oe)=>{let Q=L(C,D),U=Je?.includes(Q)||!1,io;return N&&P&&(io=Vn=>{if(Vn.nativeEvent.shiftKey&&it!==null){let Pe=S.filter(oe>it?(be,Te)=>Te>=it&&Te<=oe&&(p?p(be,Te):!0):(be,Te)=>Te>=oe&&Te<=it&&(p?p(be,Te):!0));N(U?Wt(P,Pe,be=>L(be,D)):Ze([...P,...Pe],be=>L(be,D)))}else N(U?P.filter(Pe=>L(Pe,D)!==Q):Ze([...P,C],Pe=>L(Pe,D)));Wn(oe)}),(0,O.jsx)(va,{record:C,index:oe,columns:Ue,defaultColumnProps:g,defaultColumnRender:x,selectionTrigger:M,selectionVisible:xe,selectionChecked:U,onSelectionChange:io,isRecordSelectable:p,selectionCheckboxProps:y,getSelectionCheckboxProps:c,onClick:Ga,onDoubleClick:Xa,onCellClick:Ua,onCellDoubleClick:$a,onContextMenu:Qa,onCellContextMenu:Ka,expansion:Nn,color:tn,backgroundColor:on,className:nn,style:rn,customAttributes:ln,selectorCellShadowVisible:Et,selectionColumnClassName:W,selectionColumnStyle:A,idAccessor:D,rowFactory:yn},Q)}):(0,O.jsx)(po,{})}),Ue.some(({footer:C})=>C)&&(0,O.jsx)(zo,{ref:xn,className:Xe?.footer,style:Qe?.footer,columns:Ue,defaultColumnProps:g,selectionVisible:xe,selectorCellShadowVisible:Et,scrollDiff:$e-fe})]})})}),X&&(0,O.jsx)(Ta,{ref:vn,className:Xe?.pagination,style:Qe?.pagination,horizontalSpacing:F,fetching:s,page:X,onPageChange:Hn,totalRecords:k,recordsPerPage:j,onRecordsPerPageChange:J,recordsPerPageOptions:We,recordsPerPageLabel:Ae,paginationWithEdges:ze,paginationWithControls:Ve,paginationActiveTextColor:_e,paginationActiveBackgroundColor:Fe,paginationSize:ue,paginationText:Be,paginationWrapBreakpoint:Ge,getPaginationControlProps:me,noRecordsText:Qt,loadingText:Aa,recordsLength:nt}),(0,O.jsx)(ia,{pt:xt,pb:jt,fetching:s,backgroundBlur:La,customContent:Ha,size:Ia,type:Oa,color:Wa}),(0,O.jsx)(bo,{pt:xt,pb:jt,icon:Va,text:Qt,active:!s&&!nt,children:za})]})})}var ka=require("@mantine/core"),Ea=require("@mantine/hooks"),Oe=require("react"),Na=require("react/jsx-runtime"),Xt=(0,Oe.forwardRef)(function({children:e,isDragging:t,...o},n){let a=(0,Oe.useRef)(null),r=(0,Ea.useMergedRef)(a,n);return(0,Oe.useEffect)(()=>{if(!a.current||!t)return;let d=a.current.parentElement.parentElement.children[0].children[0];for(let u=0;u<d.children.length;u++){let m=d.children[u].getBoundingClientRect(),T=a.current.children[u];T.style.height=m.height+"px",T.style.width=m.width+"px",T.style.minWidth=m.width+"px",T.style.maxWidth=m.width+"px"}},[t,e]),(0,Na.jsx)(ka.TableTr,{"data-is-dragging":t,ref:r,...o,children:e})});Xt.displayName="DataTableDraggableRow";0&&(module.exports={DataTable,DataTableDraggableRow,differenceBy,getRecordId,getValueAtPath,humanize,reorderRecords,swapRecords,uniqBy,useDataTableColumns}); | ||
"use strict";"use client";var _n=Object.create;var st=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var Gn=Object.getPrototypeOf,Xn=Object.prototype.hasOwnProperty;var Qn=(e,t)=>{for(var o in t)st(e,o,{get:t[o],enumerable:!0})},so=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Bn(t))!Xn.call(e,a)&&a!==o&&st(e,a,{get:()=>t[a],enumerable:!(n=Fn(t,a))||n.enumerable});return e};var V=(e,t,o)=>(o=e!=null?_n(Gn(e)):{},so(t||!e||!e.__esModule?st(o,"default",{value:e,enumerable:!0}):o,e)),Un=e=>so(st({},"__esModule",{value:!0}),e);var qn={};Qn(qn,{DataTable:()=>Ma,DataTableDraggableRow:()=>Xt,differenceBy:()=>Wt,getRecordId:()=>L,getValueAtPath:()=>pt,humanize:()=>he,reorderRecords:()=>Jn,swapRecords:()=>Zn,uniqBy:()=>Ze,useDataTableColumns:()=>It});module.exports=Un(qn);var wt=require("@mantine/core"),ot=require("@mantine/hooks"),Gt=V(require("clsx")),B=require("react");var Nt=require("react");var co=require("@mantine/core"),[uo,ve]=(0,co.createSafeContext)("useDataTableColumnsContext must be used within DataTableColumnProvider");var mo=require("react/jsx-runtime"),Lt=e=>{let{children:t,columnsOrder:o,setColumnsOrder:n,columnsToggle:a,setColumnsToggle:r,resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d}=e,[u,b]=(0,Nt.useState)(""),[m,T]=(0,Nt.useState)("");return(0,mo.jsx)(uo,{value:{sourceColumn:u,setSourceColumn:b,targetColumn:m,setTargetColumn:T,columnsToggle:a,setColumnsToggle:r,swapColumns:()=>{if(!o||!n||!u||!m)return;let x=o.indexOf(u),D=o.indexOf(m);if(x!==-1&&D!==-1){let S=o.splice(x,1)[0];o.splice(D,0,S),n([...o])}},resetColumnsOrder:l,resetColumnsToggle:i,setColumnWidth:s,resetColumnsWidth:d},children:t})};var Ht=require("react/jsx-runtime");function po(){return(0,Ht.jsx)("tr",{className:"mantine-datatable-empty-row",children:(0,Ht.jsx)("td",{})})}var dt=require("@mantine/core");var ae=require("react/jsx-runtime");function fo(){return(0,ae.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ae.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ae.jsx)("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"}),(0,ae.jsx)("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"}),(0,ae.jsx)("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),(0,ae.jsx)("path",{d:"M3 3l18 18"})]})}var ee=require("react/jsx-runtime");function bo({icon:e,text:t,pt:o,pb:n,active:a,children:r}){return(0,ee.jsx)(dt.Center,{pt:o,pb:n,className:"mantine-datatable-empty-state","data-active":a||void 0,children:r||(0,ee.jsxs)(ee.Fragment,{children:[e||(0,ee.jsx)("div",{className:"mantine-datatable-empty-state-icon",children:(0,ee.jsx)(fo,{})}),(0,ee.jsx)(dt.Text,{component:"div",size:"sm",c:"dimmed",children:t})]})})}var Ne=require("@mantine/core"),Wo=V(require("clsx")),Ao=require("react");var ko=require("@mantine/core"),Eo=V(require("clsx"));var ct=require("@mantine/hooks"),To=require("react"),It=({key:e,columns:t=[],getInitialValueInEffect:o=!0})=>{function n(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c)&&f.push(c)}),y.forEach(c=>{f.includes(c.accessor)||f.push(c.accessor)}),f}function a(p,y){let f=[];return p.forEach(c=>{y.find(w=>w.accessor===c.accessor)&&f.push(c)}),y.forEach(c=>{f.find(w=>w.accessor===c.accessor)||f.push({accessor:c.accessor,defaultToggle:c.defaultToggle||!0,toggleable:c.toggleable,toggled:c.defaultToggle===void 0?!0:c.defaultToggle})}),f}function r(p,y){let f=[];return p.forEach(c=>{let w=Object.keys(c)[0];y.find(h=>h.accessor===w)&&f.push(c)}),y.forEach(c=>{let w=c.accessor;if(!f.find(h=>Object.keys(h)[0]===w)){let h={};h[w]="",f.push(h)}}),f}function l(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-order`:"",defaultValue:e?d:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=n(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[c,f]}function i(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-toggle`:"",defaultValue:e?b:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=a(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[a(p,t),f]}function s(){let[p,y]=(0,ct.useLocalStorage)({key:e?`${e}-columns-width`:"",defaultValue:e?u:void 0,getInitialValueInEffect:o});function f(h){e&&y(h)}if(!e)return[p,f];let c=r(p,t),w=JSON.stringify(p);return JSON.stringify(c)!==w&&f(c),[r(p,t),f]}let d=t&&t.map(p=>p.accessor)||[],u=t&&t.map(p=>({[p.accessor]:p.width??"initial"}))||[],b=t&&t.map(p=>({accessor:p.accessor,defaultToggle:p.defaultToggle||!0,toggleable:p.toggleable,toggled:p.defaultToggle===void 0?!0:p.defaultToggle})),[m,T]=l(),[g,x]=i(),[D,S]=s(),M=()=>T(d),P=()=>{x(b)},N=()=>S(u);return{effectiveColumns:(0,To.useMemo)(()=>m?m.map(f=>t.find(c=>c.accessor===f)).map(f=>({...f,hidden:f?.hidden||!g.find(c=>c.accessor===f?.accessor)?.toggled})).map(f=>({...f,width:D.find(c=>c[f?.accessor])?.[f?.accessor]})):t,[t,m,g,D]),setColumnsOrder:T,columnsOrder:m,resetColumnsOrder:M,columnsToggle:g,setColumnsToggle:x,resetColumnsToggle:P,columnsWidth:D,setColumnsWidth:S,setColumnWidth:(p,y)=>{let f=D.map(c=>c[p]?{[p]:y}:c);S(f)},resetColumnsWidth:N}};var go=require("@mantine/hooks");function ge(){let[e]=(0,go.useResizeObserver)(),{width:t,height:o}=e.current?.getBoundingClientRect()||{width:0,height:0};return{ref:e,width:t,height:o}}var ut=require("react"),ho=typeof window<"u"?ut.useLayoutEffect:ut.useEffect;var mt=require("react");function Co(e){let[t,o]=(0,mt.useState)(null),n=e?.join(":")||"";return(0,mt.useEffect)(()=>{o(null)},[n]),{lastSelectionChangeIndex:t,setLastSelectionChangeIndex:o}}var Re=require("react");function $n(e,t){let o=()=>{t(e.map(a=>a.matches))},n=e.map(a=>{try{return a.addEventListener("change",o),()=>a.removeEventListener("change",o)}catch{return a.addListener(o),()=>a.removeListener(o)}});return()=>{n.forEach(a=>a())}}function Kn(e,t){return t||(typeof window<"u"&&"matchMedia"in window?e.map(o=>window.matchMedia(o).matches):e.map(()=>!1))}function Do(e,t,{getInitialValueInEffect:o}={getInitialValueInEffect:!0}){let[n,a]=(0,Re.useState)(o?t:Kn(e,t)),r=(0,Re.useRef)();return(0,Re.useEffect)(()=>{if("matchMedia"in window)return r.current=e.map(l=>window.matchMedia(l)),a(r.current.map(l=>l.matches)),$n(r.current,l=>{a(l)})},[e]),n}var yo=require("@mantine/core"),Ot=require("react");function wo(e){let t=(0,yo.useMantineTheme)(),o=(0,Ot.useMemo)(()=>e.map(a=>(typeof a=="function"?a(t):a)??""),[e,t]),n=(0,Ot.useMemo)(()=>e.map(()=>!0),[e]);return Do(o,n)}var So=require("@mantine/core"),xo=require("@mantine/hooks");function ne(e){let t=(0,So.useMantineTheme)(),o=typeof e=="function"?e(t):e;return(0,xo.useMediaQuery)(o||"",!0)}var Po=require("react");function he(e){let t=e.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function Wt(e,t,o){return e.filter(n=>!t.map(o).includes(o(n)))}function Ze(e,t){return e.filter((o,n,a)=>n===a.findIndex(r=>t(o)===t(r)))}function pt(e,t){return t?t.match(/([^[.\]])+/g).reduce((n,a)=>n&&n[a],e):void 0}function L(e,t){return typeof t=="string"?pt(e,t):t(e)}function Jn(e,t){let o=structuredClone(t),n=o[e.source.index];return e.destination&&(o.splice(e.source.index,1),o.splice(e.destination.index,0,n)),o}function Zn(e,t){let o=structuredClone(t),n=e.destination;if(!n)return o;let a=o[e.source.index],r=o[n.index];return o.splice(n.index,1,a),o.splice(e.source.index,1,r),o}function vo({rowExpansion:e,records:t,idAccessor:o}){let n=[];if(e&&t){let{trigger:i,allowMultiple:s,initiallyExpanded:d}=e;t&&i==="always"?n=t.map(u=>L(u,o)):d&&(n=t.filter((u,b)=>d({record:u,index:b})).map(u=>L(u,o)),s||(n=[n[0]]))}let a,r,l=(0,Po.useState)(n);if(e){let{expandable:i,trigger:s,allowMultiple:d,collapseProps:u,content:b}=e;e.expanded?{recordIds:a,onRecordIdsChange:r}=e.expanded:[a,r]=l;let m=T=>r?.(a.filter(g=>g!==L(T,o)));return{expandOnClick:s!=="always"&&s!=="never",isRowExpanded:T=>s==="always"?!0:a.includes(L(T,o)),isExpandable:({record:T,index:g})=>i?i({record:T,index:g}):!0,expandRow:T=>{let g=L(T,o);r?.(d?[...a,g]:[g])},collapseRow:m,collapseProps:u,content:({record:T,index:g})=>()=>b({record:T,index:g,collapse:()=>m(T)})}}}var At=require("@mantine/hooks"),Ye=require("react");function Ro(e,t){let[o,n]=(0,Ye.useState)(e),[a,r]=(0,Ye.useState)(e),l=(0,At.useTimeout)(()=>n(!0),0),i=(0,At.useTimeout)(()=>r(!1),t||200);return(0,Ye.useEffect)(()=>{e?(i.clear(),r(!0),l.start()):(l.clear(),n(!1),i.start())},[l,i,e]),{expanded:o,visible:a}}var Me="mantine-datatable-nowrap",ke="mantine-datatable-ellipsis",Z="mantine-datatable-pointer-cursor",ft="mantine-datatable-context-menu-cursor",Mo="mantine-datatable-text-selection-disabled",re="mantine-datatable-text-align-left",le="mantine-datatable-text-align-center",ie="mantine-datatable-text-align-right";var Lo=require("react/jsx-runtime");function No({className:e,style:t,visibleMediaQuery:o,title:n,noWrap:a,ellipsis:r,textAlign:l,width:i}){return ne(o)?(0,Lo.jsx)(ko.TableTh,{className:(0,Eo.default)({[Me]:a||r,[ke]:r,[re]:l==="left",[le]:l==="center",[ie]:l==="right"},e),style:[{width:i,minWidth:i,maxWidth:i},t],children:n}):null}var Ho=require("@mantine/core"),Oo=require("react/jsx-runtime");function Io({shadowVisible:e}){return(0,Oo.jsx)(Ho.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":e||void 0})}var Ee=require("react/jsx-runtime"),zo=(0,Ao.forwardRef)(function({className:t,style:o,columns:n,defaultColumnProps:a,selectionVisible:r,selectorCellShadowVisible:l,scrollDiff:i},s){let d=i<0;return(0,Ee.jsx)(Ne.TableTfoot,{ref:s,className:(0,Wo.default)("mantine-datatable-footer",t),style:[{position:d?"relative":"sticky",bottom:(0,Ne.rem)(d?i:0)},o],children:(0,Ee.jsxs)(Ne.TableTr,{children:[r&&(0,Ee.jsx)(Io,{shadowVisible:l}),n.map(({hidden:u,...b})=>{if(u)return null;let{accessor:m,visibleMediaQuery:T,textAlign:g,width:x,footer:D,footerClassName:S,footerStyle:M,noWrap:P,ellipsis:N}={...a,...b};return(0,Ee.jsx)(No,{className:S,style:M,visibleMediaQuery:T,textAlign:g,width:x,title:D,noWrap:P,ellipsis:N},m)})]})})});var H=require("@mantine/core"),na=V(require("clsx")),ht=require("react");var Vo=require("@mantine/core"),_o=V(require("clsx")),zt=require("react");var Bo=require("react/jsx-runtime");function Fo({group:{id:e,columns:t,title:o,textAlign:n,className:a,style:r}}){let l=(0,zt.useMemo)(()=>t.map(({visibleMediaQuery:d})=>d),[t]),i=wo(l),s=(0,zt.useMemo)(()=>t.filter(({hidden:d},u)=>!d&&i?.[u]).length,[t,i]);return s>0?(0,Bo.jsx)(Vo.TableTh,{colSpan:s,className:(0,_o.default)("mantine-datatable-column-group-header-cell",{[re]:n==="left",[le]:n==="center",[ie]:n==="right"},a),style:r,children:o??he(e)}):null}var I=require("@mantine/core"),et=V(require("clsx")),Tt=require("react");var se=require("@mantine/core"),Qo=require("@mantine/hooks");var qe=require("react/jsx-runtime");function Go(){return(0,qe.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,qe.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,qe.jsx)("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"})]})}var je=require("react/jsx-runtime");function Xo(){return(0,je.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,je.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,je.jsx)("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}var Ce=require("react/jsx-runtime");function Uo({children:e,isActive:t}){let[o,{close:n,toggle:a}]=(0,Qo.useDisclosure)(!1);return(0,Ce.jsxs)(se.Popover,{withArrow:!0,withinPortal:!0,shadow:"md",opened:o,onClose:n,trapFocus:!0,children:[(0,Ce.jsx)(se.PopoverTarget,{children:(0,Ce.jsx)(se.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":t||void 0,size:"sm",variant:"default",onClick:l=>{l.preventDefault(),a()},children:(0,Ce.jsx)(t?Xo:Go,{})})}),(0,Ce.jsx)(se.PopoverDropdown,{onClick:l=>l.stopPropagation(),children:typeof e=="function"?e({close:n}):e})]})}var $o=require("@mantine/core"),bt=require("react");var Jo=require("react/jsx-runtime"),Ko=e=>{let{accessor:t,columnRef:o}=e,n=(0,bt.useRef)(null),[a,r]=(0,bt.useState)(0),{setColumnWidth:l}=ve(),i=b=>{b.preventDefault(),b.stopPropagation(),document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),document.body.style.cursor="col-resize"},s=b=>{if(!o.current)return;let m=b.clientX-o.current.getBoundingClientRect().right,g=`${o.current.getBoundingClientRect().width+m}px`;o.current.style.width=g,l(t,o.current.style.width),r(-m)},d=()=>{o.current&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),document.body.style.cursor="initial",l(t,o.current.style.width),r(0))};return(0,Jo.jsx)("div",{ref:n,onClick:b=>b.stopPropagation(),onMouseDown:i,onDoubleClick:()=>{o.current&&(o.current.style.maxWidth="initial",o.current.style.minWidth="initial",o.current.style.width="initial",l(t,"initial"))},className:"mantine-datatable-header-resizable-handle",style:{right:(0,$o.rem)(a)}})};var De=require("react/jsx-runtime");function Zo(){return(0,De.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,De.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,De.jsx)("path",{d:"M12 5l0 14"}),(0,De.jsx)("path",{d:"M16 9l-4 -4"}),(0,De.jsx)("path",{d:"M8 9l4 -4"})]})}var ye=require("react/jsx-runtime");function Yo(){return(0,ye.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ye.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,ye.jsx)("path",{d:"M8 7l4 -4l4 4"}),(0,ye.jsx)("path",{d:"M8 17l4 4l4 -4"}),(0,ye.jsx)("path",{d:"M12 3l0 18"})]})}var Y=require("react/jsx-runtime");function qo(){return(0,Y.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Y.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Y.jsx)("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),(0,Y.jsx)("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}var Le=require("react/jsx-runtime");function jo(){return(0,Le.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Le.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Le.jsx)("path",{d:"M18 6l-12 12"}),(0,Le.jsx)("path",{d:"M6 6l12 12"})]})}var v=require("react/jsx-runtime");function ea({className:e,style:t,accessor:o,visibleMediaQuery:n,title:a,sortable:r,draggable:l,toggleable:i,resizable:s,sortIcons:d,textAlign:u,width:b,sortStatus:m,onSortStatusChange:T,filter:g,filtering:x,sortKey:D}){let{setSourceColumn:S,setTargetColumn:M,swapColumns:P,setColumnsToggle:N}=ve(),[W,A]=(0,Tt.useState)(!1),p=(0,Tt.useRef)(null);if(!ne(n))return null;let y=a??he(o),f=typeof y=="string"?y:void 0,c=r&&T?k=>{k?.defaultPrevented||T({sortKey:D,columnAccessor:o,direction:m?.columnAccessor===o?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,w=k=>{k.stopPropagation(),S(o),A(!1)},h=k=>{k.preventDefault(),M(o),A(!0)},z=()=>{M(o),A(!1),P()},F=()=>{A(!0)},X=()=>{A(!1)},te=k=>{k.stopPropagation(),N(j=>j.map(J=>J.accessor===o?{...J,toggled:!1}:J))};return(0,v.jsxs)(I.TableTh,{className:(0,et.default)({"mantine-datatable-header-cell-sortable":r,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":s},e),style:[{width:b,...s?{minWidth:"1px"}:{minWidth:b,maxWidth:b}},t],role:r?"button":void 0,tabIndex:r?0:void 0,onClick:c,onKeyDown:k=>k.key==="Enter"&&c?.(),ref:p,children:[(0,v.jsxs)(I.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[(0,v.jsxs)(I.Flex,{align:"center",w:"100%",className:(0,et.default)({"mantine-datatable-header-cell-draggable":l,"mantine-datatable-header-cell-drag-over":W}),draggable:l,onDragStart:l?w:void 0,onDragEnter:l?F:void 0,onDragOver:l?h:void 0,onDrop:l?z:void 0,onDragLeave:l?X:void 0,children:[l?(0,v.jsx)(I.Center,{role:"img","aria-label":"Drag column",children:(0,v.jsx)(I.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:k=>{k.stopPropagation()},children:(0,v.jsx)(qo,{})})}):null,(0,v.jsx)(I.Box,{className:(0,et.default)("mantine-datatable-header-cell-sortable-text",{[re]:u==="left",[le]:u==="center",[ie]:u==="right"},Me,ke),title:f,children:y})]}),i?(0,v.jsx)(I.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:(0,v.jsx)(I.ActionIcon,{size:"xs",variant:"light",onClick:te,children:(0,v.jsx)(jo,{})})}):null,r||m?.columnAccessor===o?(0,v.jsx)(v.Fragment,{children:m?.columnAccessor===o?(0,v.jsx)(I.Center,{className:(0,et.default)("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:d?.sorted||(0,v.jsx)(Zo,{})}):(0,v.jsx)(I.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:d?.unsorted||(0,v.jsx)(Yo,{})})}):null,g?(0,v.jsx)(Uo,{isActive:!!x,children:g}):null]}),s?(0,v.jsx)(Ko,{accessor:o,columnRef:p}):null]})}var gt=require("@mantine/core"),ta=V(require("clsx")),oa=require("react");var Vt=require("react/jsx-runtime"),aa=(0,oa.forwardRef)(function({className:t,style:o,trigger:n,shadowVisible:a,checked:r,indeterminate:l,checkboxProps:i,onChange:s,rowSpan:d},u){let b=!i.disabled;return(0,Vt.jsx)(gt.TableTh,{ref:u,className:(0,ta.default)("mantine-datatable-header-selector-cell",{[Z]:n==="cell"&&b},t),style:o,rowSpan:d,"data-shadow-visible":a||void 0,onClick:n==="cell"&&b?s:void 0,children:(0,Vt.jsx)(gt.Checkbox,{classNames:b?{input:Z}:void 0,checked:r,indeterminate:l,onChange:s,...i,disabled:!(s||i.onChange)||i.disabled})})});var _=require("react/jsx-runtime"),ra=(0,ht.forwardRef)(function({selectionColumnHeaderRef:t,className:o,style:n,sortStatus:a,sortIcons:r,onSortStatusChange:l,columns:i,defaultColumnProps:s,groups:d,selectionTrigger:u,selectionVisible:b,selectionChecked:m,selectionIndeterminate:T,onSelectionChange:g,selectionCheckboxProps:x,selectorCellShadowVisible:D,selectionColumnClassName:S,selectionColumnStyle:M},P){let N=b?(0,_.jsx)(aa,{ref:t,className:S,style:M,trigger:u,shadowVisible:D,checked:m,indeterminate:T,checkboxProps:x,onChange:g,rowSpan:d?2:void 0}):null,{columnsToggle:W,setColumnsToggle:A}=ve(),[p,y]=(0,ht.useState)(!1),f=i.some(h=>h.toggleable),c=f?Object.fromEntries(i.map(({accessor:h,title:z})=>[h,z??he(String(h))])):void 0,w=(0,_.jsxs)(H.TableThead,{className:(0,na.default)("mantine-datatable-header",o),style:n,ref:P,onContextMenu:f?h=>{h.preventDefault(),y(z=>!z)}:void 0,children:[d&&(0,_.jsxs)(H.TableTr,{children:[N,d.map(h=>(0,_.jsx)(Fo,{group:h},h.id))]}),(0,_.jsxs)(H.TableTr,{children:[!d&&N,i.map(({hidden:h,...z},F)=>{if(h)return null;let{accessor:X,visibleMediaQuery:te,textAlign:k,width:j,title:J,sortable:We,draggable:Ae,toggleable:ze,resizable:Ve,titleClassName:_e,titleStyle:Fe,filter:ue,filtering:Be,sortKey:Ge}={...s,...z};return(0,_.jsx)(ea,{accessor:X,className:_e,style:Fe,visibleMediaQuery:te,textAlign:k,width:j,title:J,sortable:We,draggable:Ae,toggleable:ze,resizable:Ve&&F<i.length-1,sortStatus:a,sortIcons:r,sortKey:Ge,onSortStatusChange:l,filter:ue,filtering:Be},X)})]})]});return f?(0,_.jsxs)(H.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:p,onChange:y,children:[(0,_.jsx)(H.PopoverTarget,{children:w}),(0,_.jsx)(H.PopoverDropdown,{children:(0,_.jsx)(H.Stack,{children:W.filter(h=>h.toggleable).map(h=>(0,_.jsx)(H.Group,{children:(0,_.jsx)(H.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:c[h.accessor],checked:h.toggled,onChange:z=>{A(W.map(F=>F.accessor===h.accessor?{...F,toggled:z.currentTarget.checked}:F))}})},h.accessor))})})]}):w});var Ct=require("@mantine/core"),la=V(require("clsx")),_t=require("react/jsx-runtime");function ia({pt:e,pb:t,fetching:o,customContent:n,backgroundBlur:a,size:r,type:l,color:i}){return(0,_t.jsx)(Ct.Center,{pt:e,pb:t,className:(0,la.default)("mantine-datatable-loader",{"mantine-datatable-loader-fetching":o}),style:[{backdropFilter:a?`blur(${a}px)`:void 0}],children:o&&(n||(0,_t.jsx)(Ct.Loader,{size:r,type:l,color:i}))})}var de=require("@mantine/core"),Ft=V(require("clsx")),ba=require("react");var R=require("@mantine/core"),pa=V(require("clsx"));var sa=require("@mantine/core");function E(e,t,o){return e?(0,sa.parseThemeColor)({color:typeof e=="object"?e[o]:e,theme:t}).value:void 0}function da({theme:e,c:t,backgroundColor:o,borderColor:n,rowBorderColor:a,stripedColor:r,highlightOnHoverColor:l}){return{"--mantine-datatable-color-light":E(t,e,"light"),"--mantine-datatable-color-dark":E(t,e,"dark"),"--mantine-datatable-background-color-light":E(o,e,"light"),"--mantine-datatable-background-color-dark":E(o,e,"dark"),"--mantine-datatable-border-color-light":E(n,e,"light"),"--mantine-datatable-border-color-dark":E(n,e,"dark"),"--mantine-datatable-row-border-color-light":E(a,e,"light"),"--mantine-datatable-row-border-color-dark":E(a,e,"dark"),"--mantine-datatable-striped-color-light":E(r,e,"light"),"--mantine-datatable-striped-color-dark":E(r,e,"dark"),"--mantine-datatable-highlight-on-hover-color-light":E(l,e,"light"),"--mantine-datatable-highlight-on-hover-color-dark":E(l,e,"dark")}}function Dt({theme:e,paginationActiveTextColor:t,paginationActiveBackgroundColor:o}){return{"--mantine-datatable-pagination-active-text-color-light":E(t,e,"light"),"--mantine-datatable-pagination-active-text-color-dark":E(t,e,"dark"),"--mantine-datatable-pagination-active-background-color-light":E(o,e,"light"),"--mantine-datatable-pagination-active-background-color-dark":E(o,e,"dark")}}function ca({theme:e,color:t,backgroundColor:o}){return{"--mantine-datatable-row-color-light":E(t,e,"light"),"--mantine-datatable-row-color-dark":E(t,e,"dark"),"--mantine-datatable-row-background-color-light":E(o,e,"light"),"--mantine-datatable-row-background-color-dark":E(o,e,"dark")}}var He=require("react/jsx-runtime");function ua(){return(0,He.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,He.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,He.jsx)("path",{d:"M8 9l4 -4l4 4"}),(0,He.jsx)("path",{d:"M16 15l-4 4l-4 -4"})]})}var $=require("react/jsx-runtime"),ma={xs:(0,R.rem)(22),sm:(0,R.rem)(26),md:(0,R.rem)(32),lg:(0,R.rem)(38),xl:(0,R.rem)(44)};function fa({size:e,label:t,values:o,value:n,activeTextColor:a,activeBackgroundColor:r,onChange:l}){return(0,$.jsxs)(R.Group,{gap:"xs",children:[(0,$.jsx)(R.Text,{component:"div",size:e,children:t}),(0,$.jsxs)(R.Menu,{withinPortal:!0,withArrow:!0,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[(0,$.jsx)(R.MenuTarget,{children:(0,$.jsx)(R.Button,{size:e,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:(0,$.jsx)(ua,{}),style:[{fontWeight:"normal"},i=>({height:ma[e],paddingLeft:i.spacing[e],paddingRight:i.spacing[e]})],children:n})}),(0,$.jsx)(R.MenuDropdown,{children:o.map(i=>{let s=i===n;return(0,$.jsx)(R.MenuItem,{className:(0,pa.default)({"mantine-datatable-page-size-selector-active":s}),style:[{height:ma[e]},s&&(a||r)?d=>Dt({theme:d,paginationActiveTextColor:a,paginationActiveBackgroundColor:r}):void 0],disabled:s,onClick:()=>l(i),children:(0,$.jsx)(R.Text,{component:"div",size:e,children:i})},i)})})]})]})}var Ie=require("react/jsx-runtime"),Ta=(0,ba.forwardRef)(function({className:t,style:o,fetching:n,page:a,onPageChange:r,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:s,paginationActiveBackgroundColor:d,paginationSize:u,loadingText:b,noRecordsText:m,paginationText:T,totalRecords:g,recordsPerPage:x,onRecordsPerPageChange:D,recordsPerPageLabel:S,recordsPerPageOptions:M,recordsLength:P,horizontalSpacing:N,paginationWrapBreakpoint:W,getPaginationControlProps:A},p){let y;if(g){let c=(a-1)*x+1,w=c+(P||0)-1;y=T({from:c,to:w,totalRecords:g})}else y=n?b:m;let f=ne(({breakpoints:c})=>`(min-width: ${typeof W=="number"?`${(0,de.rem)(W)}rem`:c[W]||W})`);return(0,Ie.jsxs)(de.Box,{ref:p,px:N??"xs",py:"xs",className:(0,Ft.default)("mantine-datatable-pagination",t),style:[{flexDirection:f?"row":"column"},o],children:[(0,Ie.jsx)(de.Text,{component:"div",className:"mantine-datatable-pagination-text",size:u,children:y}),M&&(0,Ie.jsx)(fa,{activeTextColor:s,activeBackgroundColor:d,size:u,label:S,values:M,value:x,onChange:D}),(0,Ie.jsx)(de.Pagination,{classNames:{root:(0,Ft.default)("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!P}),control:"mantine-datatable-pagination-pages-control"},style:s||d?c=>Dt({theme:c,paginationActiveTextColor:s,paginationActiveBackgroundColor:d}):void 0,withEdges:l,withControls:i,value:a,onChange:r,size:u,total:Math.ceil(g/x),getControlProps:A})]})});var xa=require("@mantine/core"),Pa=V(require("clsx"));var ga=require("@mantine/core"),ha=V(require("clsx"));var Da=require("react/jsx-runtime");function Ca({className:e,style:t,visibleMediaQuery:o,record:n,index:a,onClick:r,onDoubleClick:l,onContextMenu:i,noWrap:s,ellipsis:d,textAlign:u,width:b,accessor:m,render:T,defaultRender:g,customCellAttributes:x}){return ne(o)?(0,Da.jsx)(ga.TableTd,{className:(0,ha.default)({[Me]:s||d,[ke]:d,[Z]:r||l,[ft]:i,[re]:u==="left",[le]:u==="center",[ie]:u==="right"},e),style:[{width:b,minWidth:b,maxWidth:b},t],onClick:r,onDoubleClick:l,onContextMenu:i,...x?.(n,a),children:T?T(n,a):g?g(n,a,m):pt(n,m)}):null}var we=require("@mantine/core");var q=require("react/jsx-runtime");function ya({open:e,colSpan:t,content:o,collapseProps:n}){let{expanded:a,visible:r}=Ro(e,n?.transitionDuration);return r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(we.TableTr,{}),(0,q.jsx)(we.TableTr,{children:(0,q.jsx)(we.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:t,children:(0,q.jsx)(we.Collapse,{in:a,...n,children:(0,q.jsx)("div",{className:"mantine-datatable-row-expansion-cell-content",children:o()})})})})]}):null}var yt=require("@mantine/core"),wa=V(require("clsx"));var Bt=require("react/jsx-runtime");function Sa({className:e,style:t,record:o,index:n,trigger:a,onChange:r,withRightShadow:l,checkboxProps:i,getCheckboxProps:s,...d}){let u={...i,...s(o,n)},b=!d.disabled&&!u.disabled,m=T=>{T.stopPropagation(),a==="cell"&&b&&r?.(T)};return(0,Bt.jsx)(yt.TableTd,{className:(0,wa.default)("mantine-datatable-row-selector-cell",{[Z]:a==="cell"&&b},e),style:t,"data-shadow-visible":l||void 0,onClick:m,children:(0,Bt.jsx)(yt.Checkbox,{classNames:b?{input:Z}:void 0,onChange:r,...d,...u})})}var K=require("react/jsx-runtime");function va({record:e,index:t,columns:o,defaultColumnProps:n,defaultColumnRender:a,selectionTrigger:r,selectionVisible:l,selectionChecked:i,onSelectionChange:s,isRecordSelectable:d,selectionCheckboxProps:u,getSelectionCheckboxProps:b,onClick:m,onDoubleClick:T,onContextMenu:g,onCellClick:x,onCellDoubleClick:D,onCellContextMenu:S,expansion:M,customAttributes:P,color:N,backgroundColor:W,className:A,style:p,selectorCellShadowVisible:y,selectionColumnClassName:f,selectionColumnStyle:c,rowFactory:w}){let h=(0,K.jsxs)(K.Fragment,{children:[l&&(0,K.jsx)(Sa,{className:f,style:c,record:e,index:t,trigger:r,withRightShadow:y,checked:i,disabled:!s||(d?!d(e,t):!1),onChange:s,checkboxProps:u,getCheckboxProps:b}),o.map(({hidden:X,hiddenContent:te,...k},j)=>{if(X||te)return null;let{accessor:J,visibleMediaQuery:We,textAlign:Ae,noWrap:ze,ellipsis:Ve,width:_e,render:Fe,cellsClassName:ue,cellsStyle:Be,customCellAttributes:Ge}={...n,...k};return(0,K.jsx)(Ca,{className:typeof ue=="function"?ue(e,t):ue,style:Be?.(e,t),visibleMediaQuery:We,record:e,index:t,onClick:x?me=>x({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,onDoubleClick:D?me=>D({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,onContextMenu:S?me=>S({event:me,record:e,index:t,column:k,columnIndex:j}):void 0,accessor:J,textAlign:Ae,noWrap:ze,ellipsis:Ve,width:_e,render:Fe,defaultRender:a,customCellAttributes:Ge},J)})]}),z=M&&(0,K.jsx)(ya,{colSpan:o.filter(({hidden:X})=>!X).length+(l?1:0),open:M.isRowExpanded(e),content:M.content({record:e,index:t}),collapseProps:M.collapseProps}),F=Yn({record:e,index:t,selectionChecked:i,onClick:m,onDoubleClick:T,onContextMenu:g,expansion:M,customAttributes:P,color:N,backgroundColor:W,className:A,style:p});return w?w({record:e,index:t,rowProps:F,children:h,expandedElement:z}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(xa.TableTr,{...F,children:h}),z]})}function Yn({record:e,index:t,selectionChecked:o,onClick:n,onDoubleClick:a,onContextMenu:r,expansion:l,customAttributes:i,color:s,backgroundColor:d,className:u,style:b}){return{className:(0,Pa.default)("mantine-datatable-row",{[Z]:n||a||l?.isExpandable({record:e,index:t})&&l?.expandOnClick},{[ft]:r},typeof u=="function"?u(e,t):u),"data-selected":o||void 0,onClick:m=>{if(l){let{isExpandable:T,isRowExpanded:g,expandOnClick:x,expandRow:D,collapseRow:S}=l;T({record:e,index:t})&&x&&(g(e)?S(e):D(e))}n?.({event:m,record:e,index:t})},onDoubleClick:a?m=>a({event:m,record:e,index:t}):void 0,onContextMenu:r?m=>r({event:m,record:e,index:t}):void 0,style:[s||d?m=>{let T=s?.(e,t),g=d?.(e,t);return ca({theme:m,color:T,backgroundColor:g})}:void 0,b?.(e,t)],...i?.(e,t)??{}}}var ce=require("@mantine/core"),tt=V(require("clsx")),Se=require("react/jsx-runtime");function Ra({topShadowVisible:e,leftShadowVisible:t,leftShadowBehind:o,rightShadowVisible:n,rightShadowBehind:a,bottomShadowVisible:r,headerHeight:l,footerHeight:i,onScrollPositionChange:s,children:d,viewportRef:u,scrollAreaProps:b}){return(0,Se.jsxs)(ce.ScrollArea,{...b,viewportRef:u,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:s,children:[d,(0,Se.jsx)(ce.Box,{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow",{"mantine-datatable-scroll-area-shadow-visible":e}),style:{top:l?(0,ce.rem)(l):0}}),(0,Se.jsx)("div",{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-visible":t,"mantine-datatable-scroll-area-shadow-behind":o})}),(0,Se.jsx)("div",{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-visible":n,"mantine-datatable-scroll-area-shadow-behind":a})}),(0,Se.jsx)(ce.Box,{className:(0,tt.default)("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow",{"mantine-datatable-scroll-area-shadow-visible":r}),style:{bottom:i?(0,ce.rem)(i+1):0}})]})}var O=require("react/jsx-runtime");function Ma({withTableBorder:e,borderRadius:t,textSelectionDisabled:o,height:n="100%",minHeight:a,maxHeight:r,shadow:l,verticalAlign:i="center",fetching:s,columns:d,storeColumnsKey:u,groups:b,pinFirstColumn:m,pinLastColumn:T,defaultColumnProps:g,defaultColumnRender:x,idAccessor:D="id",records:S,selectionTrigger:M="checkbox",selectedRecords:P,onSelectedRecordsChange:N,selectionColumnClassName:W,selectionColumnStyle:A,isRecordSelectable:p,selectionCheckboxProps:y,allRecordsSelectionCheckboxProps:f={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:c=(G,pe)=>({"aria-label":`Select record ${pe+1}`}),sortStatus:w,sortIcons:h,onSortStatusChange:z,horizontalSpacing:F,page:X,onPageChange:te,totalRecords:k,recordsPerPage:j,onRecordsPerPageChange:J,recordsPerPageOptions:We,recordsPerPageLabel:Ae="Records per page",paginationWithEdges:ze,paginationWithControls:Ve,paginationActiveTextColor:_e,paginationActiveBackgroundColor:Fe,paginationSize:ue="sm",paginationText:Be=({from:G,to:pe,totalRecords:fe})=>`${G} - ${pe} / ${fe}`,paginationWrapBreakpoint:Ge="sm",getPaginationControlProps:me=G=>G==="previous"?{"aria-label":"Previous page"}:G==="next"?{"aria-label":"Next page"}:{},loaderBackgroundBlur:La,customLoader:Ha,loaderSize:Ia,loaderType:Oa,loaderColor:Wa,loadingText:Aa="...",emptyState:za,noRecordsText:Qt="No records",noRecordsIcon:Va,highlightOnHover:_a,striped:Fa,noHeader:Ba,onRowClick:Ga,onRowDoubleClick:Xa,onRowContextMenu:Qa,onCellClick:Ua,onCellDoubleClick:$a,onCellContextMenu:Ka,onScroll:Ut,onScrollToTop:$t,onScrollToBottom:Kt,onScrollToLeft:Jt,onScrollToRight:Zt,c:Ja,backgroundColor:Za,borderColor:Ya,rowBorderColor:qa,stripedColor:ja,highlightOnHoverColor:en,rowColor:tn,rowBackgroundColor:on,rowExpansion:an,rowClassName:nn,rowStyle:rn,customRowAttributes:ln,scrollViewportRef:sn,scrollAreaProps:dn,tableRef:cn,bodyRef:un,m:mn,my:pn,mx:fn,mt:bn,mb:Tn,ml:gn,mr:hn,className:Cn,classNames:Xe,style:Dn,styles:Qe,rowFactory:yn,tableWrapper:St,...Yt}){let{ref:G,width:pe,height:fe}=ge(),Ue=(0,B.useMemo)(()=>b?.flatMap(C=>C.columns)??d,[d,b]),qt=It({key:u,columns:Ue}),{ref:wn,height:xt}=ge(),{ref:Sn,width:Pt,height:$e}=ge(),{ref:xn,height:Pn}=ge(),{ref:vn,height:jt}=ge(),{ref:Rn,width:Mn}=ge(),kn=(0,ot.useMergedRef)(Sn,cn),En=(0,ot.useMergedRef)(G,sn),[vt,eo]=(0,B.useState)(!0),[Rt,to]=(0,B.useState)(!0),[Ke,oo]=(0,B.useState)(!0),[at,ao]=(0,B.useState)(!0),Nn=vo({rowExpansion:an,records:S,idAccessor:D}),Mt=(0,B.useCallback)(()=>{let C=G.current?.scrollTop??0,oe=G.current?.scrollLeft??0;if(s||$e<=fe)eo(!0),to(!0);else{let Q=C===0,U=$e-C-fe<1;eo(Q),to(U),Q&&Q!==vt&&$t?.(),U&&U!==Rt&&Kt?.()}if(s||Pt===pe)oo(!0),ao(!0);else{let Q=oe===0,U=Pt-oe-pe<1;oo(Q),ao(U),Q&&Q!==Ke&&Jt?.(),U&&U!==at&&Zt?.()}},[s,Kt,Jt,Zt,$t,fe,G,pe,Rt,Ke,at,vt,$e,Pt]);ho(Mt,[Mt]);let no=(0,ot.useDebouncedCallback)(Mt,50),Ln=(0,B.useCallback)(C=>{Ut?.(C),no()},[no,Ut]),Hn=(0,B.useCallback)(C=>{G.current?.scrollTo({top:0,left:0}),te(C)},[te,G]),nt=S?.length,ro=S?.map(C=>L(C,D)),xe=!!P,Je=P?.map(C=>L(C,D)),lo=ro!==void 0&&Je!==void 0&&Je.length>0,kt=p?S?.filter(p):S,rt=kt?.map(C=>L(C,D)),lt=lo&&rt.every(C=>Je.includes(C)),In=lo&&rt.some(C=>Je.includes(C)),On=(0,B.useCallback)(()=>{P&&N&&N(lt?P.filter(C=>!rt.includes(L(C,D))):Ze([...P,...kt],C=>L(C,D)))},[lt,D,N,rt,kt,P]),{lastSelectionChangeIndex:it,setLastSelectionChangeIndex:Wn}=Co(ro),Et=xe&&!Ke&&!m,An={m:mn,my:pn,mx:fn,mt:bn,mb:Tn,ml:gn,mr:hn},zn=(0,B.useCallback)(({children:C})=>St?St({children:C}):C,[St]);return(0,O.jsx)(Lt,{...qt,children:(0,O.jsxs)(wt.Box,{...An,className:(0,Gt.default)("mantine-datatable",{"mantine-datatable-with-border":e},Cn,Xe?.root),style:[C=>({...da({theme:C,c:Ja,backgroundColor:Za,borderColor:Ya,rowBorderColor:qa,stripedColor:ja,highlightOnHoverColor:en}),borderRadius:C.radius[t]||t,boxShadow:C.shadows[l]||l,height:n,minHeight:a,maxHeight:r}),Dn,Qe?.root,{position:"relative"}],children:[(0,O.jsx)(Ra,{viewportRef:En,topShadowVisible:!vt,leftShadowVisible:!Ke,leftShadowBehind:xe||!!m,rightShadowVisible:!at,rightShadowBehind:T,bottomShadowVisible:!Rt,headerHeight:xt,footerHeight:Pn,onScrollPositionChange:Ln,scrollAreaProps:dn,children:(0,O.jsx)(zn,{children:(0,O.jsxs)(wt.Table,{ref:kn,horizontalSpacing:F,className:(0,Gt.default)("mantine-datatable-table",{[Mo]:o,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-last-row-border-bottom-visible":Yt.withRowBorders&&$e<fe,"mantine-datatable-pin-last-column":T,"mantine-datatable-pin-last-column-scrolled":!at&&T,"mantine-datatable-selection-column-visible":xe,"mantine-datatable-pin-first-column":m,"mantine-datatable-pin-first-column-scrolled":!Ke&&m},Xe?.table),style:{...Qe?.table,"--mantine-datatable-selection-column-width":`${Mn}px`},"data-striped":nt&&Fa||void 0,"data-highlight-on-hover":_a||void 0,...Yt,children:[Ba?null:(0,O.jsx)(Lt,{...qt,children:(0,O.jsx)(ra,{ref:wn,selectionColumnHeaderRef:Rn,className:Xe?.header,style:Qe?.header,columns:Ue,defaultColumnProps:g,groups:b,sortStatus:w,sortIcons:h,onSortStatusChange:z,selectionTrigger:M,selectionVisible:xe,selectionChecked:lt,selectionIndeterminate:In&&!lt,onSelectionChange:On,selectionCheckboxProps:{...y,...f},selectorCellShadowVisible:Et,selectionColumnClassName:W,selectionColumnStyle:A})}),(0,O.jsx)("tbody",{ref:un,children:nt?S.map((C,oe)=>{let Q=L(C,D),U=Je?.includes(Q)||!1,io;return N&&P&&(io=Vn=>{if(Vn.nativeEvent.shiftKey&&it!==null){let Pe=S.filter(oe>it?(be,Te)=>Te>=it&&Te<=oe&&(p?p(be,Te):!0):(be,Te)=>Te>=oe&&Te<=it&&(p?p(be,Te):!0));N(U?Wt(P,Pe,be=>L(be,D)):Ze([...P,...Pe],be=>L(be,D)))}else N(U?P.filter(Pe=>L(Pe,D)!==Q):Ze([...P,C],Pe=>L(Pe,D)));Wn(oe)}),(0,O.jsx)(va,{record:C,index:oe,columns:Ue,defaultColumnProps:g,defaultColumnRender:x,selectionTrigger:M,selectionVisible:xe,selectionChecked:U,onSelectionChange:io,isRecordSelectable:p,selectionCheckboxProps:y,getSelectionCheckboxProps:c,onClick:Ga,onDoubleClick:Xa,onCellClick:Ua,onCellDoubleClick:$a,onContextMenu:Qa,onCellContextMenu:Ka,expansion:Nn,color:tn,backgroundColor:on,className:nn,style:rn,customAttributes:ln,selectorCellShadowVisible:Et,selectionColumnClassName:W,selectionColumnStyle:A,idAccessor:D,rowFactory:yn},Q)}):(0,O.jsx)(po,{})}),Ue.some(({footer:C})=>C)&&(0,O.jsx)(zo,{ref:xn,className:Xe?.footer,style:Qe?.footer,columns:Ue,defaultColumnProps:g,selectionVisible:xe,selectorCellShadowVisible:Et,scrollDiff:$e-fe})]})})}),X&&(0,O.jsx)(Ta,{ref:vn,className:Xe?.pagination,style:Qe?.pagination,horizontalSpacing:F,fetching:s,page:X,onPageChange:Hn,totalRecords:k,recordsPerPage:j,onRecordsPerPageChange:J,recordsPerPageOptions:We,recordsPerPageLabel:Ae,paginationWithEdges:ze,paginationWithControls:Ve,paginationActiveTextColor:_e,paginationActiveBackgroundColor:Fe,paginationSize:ue,paginationText:Be,paginationWrapBreakpoint:Ge,getPaginationControlProps:me,noRecordsText:Qt,loadingText:Aa,recordsLength:nt}),(0,O.jsx)(ia,{pt:xt,pb:jt,fetching:s,backgroundBlur:La,customContent:Ha,size:Ia,type:Oa,color:Wa}),(0,O.jsx)(bo,{pt:xt,pb:jt,icon:Va,text:Qt,active:!s&&!nt,children:za})]})})}var ka=require("@mantine/core"),Ea=require("@mantine/hooks"),Oe=require("react"),Na=require("react/jsx-runtime"),Xt=(0,Oe.forwardRef)(function({children:e,isDragging:t,...o},n){let a=(0,Oe.useRef)(null),r=(0,Ea.useMergedRef)(a,n);return(0,Oe.useEffect)(()=>{if(!a.current||!t)return;let d=a.current.parentElement.parentElement.children[0].children[0];for(let u=0;u<d.children.length;u++){let m=d.children[u].getBoundingClientRect(),T=a.current.children[u];T.style.height=m.height+"px",T.style.width=m.width+"px",T.style.minWidth=m.width+"px",T.style.maxWidth=m.width+"px"}},[t,e]),(0,Na.jsx)(ka.TableTr,{"data-is-dragging":t,ref:r,...o,children:e})});Xt.displayName="DataTableDraggableRow";0&&(module.exports={DataTable,DataTableDraggableRow,differenceBy,getRecordId,getValueAtPath,humanize,reorderRecords,swapRecords,uniqBy,useDataTableColumns}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "mantine-datatable", | ||
"version": "7.12.3", | ||
"version": "7.12.4", | ||
"description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
557993