import{ac as C,u as h,aA as f,e0 as x,aF as k,cl as g,ak as j,j as e,ae as v,k as T,aG as _,aJ as A,aK as a}from"./bundle.CHKSNOJF.js";import{D as y}from"./DataTableColumnsPicker-Cp4QPk4h.js";import{u as F,a as P,c as D,d as E}from"./hooks-9RDJr6hd.js";import{u as R}from"./useCustomBulkActions-2sCvVKfD.js";import"./CreditStatus-WHg8w3rC.js";import"./useInvoiceColumns-CGbyIb88.js";import"./InvoiceStatus-1S0ZEgN9.js";import"./invoice-status-C0SI5VYC.js";import"./useDownloadPdfs-CUk8lkB_.js";import"./payments-C1sjF6lG.js";import"./atoms-BuQpgpbC.js";function K(){return[{column:"date",queryParameterKey:"date_range"},{column:"due_date",queryParameterKey:"due_date_range"},{column:"created_at",queryParameterKey:"created_between"}]}function I(){C("credits");const[t]=h(),i=f(),r=[{name:t("credits"),href:"/credits"}],n=F(),c=P(),l=x(),o=D(),u=K(),d=R(),{changeTemplateVisible:m,setChangeTemplateVisible:p,changeTemplateResources:b}=k();return g({on:["App\\Events\\Credit\\CreditWasCreated","App\\Events\\Credit\\CreditWasUpdated"],callback:()=>j(["credits"])}),e.jsxs(v,{title:t("credits"),breadcrumbs:r,docsLink:"en/credits/",children:[e.jsx(T,{resource:"credit",endpoint:"/api/v1/credits?include=client&without_deleted_clients=true&sort=id|desc",bulkRoute:"/api/v1/credits/bulk",columns:c,linkToCreate:"/credits/create",linkToEdit:"/credits/:id/edit",customActions:n,customBulkActions:d,customFilters:l,customFilterPlaceholder:"status",withResourcefulActions:!0,rightSide:e.jsx(y,{columns:o,defaultColumns:E,table:"credit"}),dateRangeColumns:u,linkToCreateGuards:[_("create_credit")],hideEditableOptions:!i("edit_credit"),enableSavingFilterPreference:!0,enableSavingLatestDataForNavigation:!0}),e.jsx(A,{entity:"credit",entities:b,visible:m,setVisible:p,labelFn:s=>e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx(a,{children:t("number")}),e.jsx("span",{children:s.number})]}),bulkLabelFn:s=>e.jsxs("div",{className:"flex space-x-2",children:[e.jsxs(a,{children:[t("number"),":"]}),e.jsx("span",{children:s.number})]}),bulkUrl:"/api/v1/credits/bulk"})]})}export{I as default};
