import{ac as A,u as D,aA as P,g as R,p as a,aB as l,cp as N,dN as E,dM as I,y as V,dU as w,h as B,aF as K,j as e,ae as G,k as L,aG as u,f6 as H,aH as M,aI as U,aJ as J,aK as c}from"./bundle.CHKSNOJF.js";import{D as O}from"./DataTableColumnsPicker-Cp4QPk4h.js";import{I as z}from"./ImportButton-CAP92Rev.js";import{a as W,u as X}from"./useFooterColumns-x3T2t0hU.js";import{q as Y,a as Z,Q as $}from"./QuoteSlider-CSUbgZN6.js";import{u as ee}from"./queries-B-4Pq9fP.js";import{D as te}from"./DataTableFooterColumnsPicker-BoP9izHT.js";import"./Import-DLbAH8Kx.js";import"./useDownloadPdfs-CUk8lkB_.js";import"./useSumTableColumn-CvAhhSYq.js";import"./EmailRecord-BnH9Xgsc.js";import"./InvoiceStatus-1S0ZEgN9.js";import"./invoice-status-C0SI5VYC.js";import"./CloudPlay-DAhKDxQn.js";import"./chevron-right-CHJ6fP-X.js";import"./History-n6M92Y0g.js";function se(){return[{column:"date",queryParameterKey:"date_range"},{column:"due_date",queryParameterKey:"due_date_range"},{column:"created_at",queryParameterKey:"created_between"}]}function ge(){const{documentTitle:i}=A("quotes"),[s]=D(),m=P(),d=R(),[p,b]=a.useState(""),[f,q]=l(Y),[r,n]=l(Z),x=N(),h=E(),g=I(),C=V(),j=w(),T=se(),k=W(),{footerColumns:y,allFooterColumns:S}=X(),{data:o}=ee({id:p}),_=[{name:s("quotes"),href:B("/quotes")}];a.useEffect(()=>{o&&r&&q(o)},[o,r]),a.useEffect(()=>()=>n(!1),[]);const{changeTemplateVisible:v,setChangeTemplateVisible:Q,changeTemplateResources:F}=K();return e.jsxs(G,{title:i,breadcrumbs:_,children:[e.jsx(L,{resource:"quote",columns:g,footerColumns:y,endpoint:"/api/v1/quotes?include=client&without_deleted_clients=true&sort=id|desc",linkToEdit:"/quotes/:id/edit",linkToCreate:"/quotes/create",bulkRoute:"/api/v1/quotes/bulk",customActions:x,customBulkActions:k,customFilters:h,customFilterPlaceholder:"status",withResourcefulActions:!0,rightSide:e.jsxs("div",{className:"flex items-center space-x-2",children:[!!C.show_table_footer&&e.jsx(te,{table:"quote",columns:S}),e.jsx(O,{columns:j,defaultColumns:H,table:"quote"}),e.jsx(M,{type:"component",guards:[U(u("create_quote"),u("edit_quote"))],component:e.jsx(z,{route:"/quotes/import"})})]}),onTableRowClick:t=>{b(t.id),n(!0)},dateRangeColumns:T,linkToCreateGuards:[u("create_quote")],hideEditableOptions:!m("edit_quote"),enableSavingFilterPreference:!0,enableSavingLatestDataForNavigation:!0}),!d("quote",f)&&e.jsx($,{}),e.jsx(J,{entity:"quote",entities:F,visible:v,setVisible:Q,labelFn:t=>e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx(c,{children:s("number")}),e.jsx("span",{children:t.number})]}),bulkLabelFn:t=>e.jsxs("div",{className:"flex space-x-2",children:[e.jsxs(c,{children:[s("number"),":"]}),e.jsx("span",{children:t.number})]}),bulkUrl:"/api/v1/quotes/bulk"})]})}export{ge as default};
