import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as ee,s as m,u as h,v as g,y as _}from"./VDataTable-DTGuaGIw.js";import{$n as v,$t as y,Kn as b,Mn as te,Tr as x,Wn as S,an as C,dr as w,ir as T,j as E,ln as D,on as ne,qn as O,wr as k}from"./index-BnXe9Zb0.js";var A=D({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=C()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:d,slots:_}){let{groupBy:C}=r(e),{initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=x(e),I=b(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:C,showSelect:k(()=>e.showSelect),showExpand:k(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:C,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,C,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=b(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:C,search:k(()=>e.search)}),w(`v-data-table`,{toggleSort:B,sortBy:A}),ne({VDataTableRows:{hideNoData:k(()=>e.hideNoData),noDataText:k(()=>e.noDataText),loading:k(()=>e.loading),loadingText:k(()=>e.loadingText)}});let $=b(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));y(()=>{let n=o.filterProps(e),r=i.filterProps(te(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return v(t,T({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):O(S,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&O(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[v(i,T(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&O(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):v(f,T(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&O(S,null,[v(E,null,null),v(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};