import{al as u}from"./index-ktJf6c6X.js";const r=u.injectEndpoints({endpoints:a=>({saveLeadDetails:a.mutation({query:e=>({url:"lead",method:"POST",body:e})}),updateLeadDetails:a.mutation({query:e=>({url:"lead",method:"PUT",body:e})}),getLeadById:a.query({query:e=>`leads/${e}`}),getLeadFullById:a.query({query:e=>`lead/full/${e}`}),getLeadsByPage:a.mutation({query:({searchByName:e,page:t,size:o,includeCounts:s})=>({url:`lead/search-by-criteria?page=${t}&size=${o}${s===!1?"&includeCounts=false":""}`,method:"POST",body:e})}),getLeadsByPageForAc:a.mutation({query:({searchByName:e})=>({url:"lead/search-by-criteria?page=0&size=30",method:"POST",body:e})}),searchLeadsForArtApproval:a.mutation({query:({searchByName:e})=>({url:"lead/search-for-art-approval?page=0&size=30",method:"POST",body:e})}),searchLeadsForFollowUp:a.mutation({query:({searchByName:e})=>({url:"lead/search-for-follow-up?page=0&size=30",method:"POST",body:e})}),searchLeadsForCostEstimation:a.mutation({query:({searchByName:e})=>({url:"lead/search-for-cost-estimation?page=0&size=30",method:"POST",body:e})}),searchLeadsForQuotation:a.mutation({query:({searchByName:e})=>({url:"lead/search-for-quotation?page=0&size=30",method:"POST",body:e})}),searchLeadsForOrder:a.mutation({query:({searchByName:e})=>({url:"lead/search-for-order?page=0&size=30",method:"POST",body:e})}),rejectLeadQuotation:a.mutation({query:e=>({url:`lead/${e}/reject-quotation`,method:"POST"}),invalidatesTags:["Lead"]}),getLeadList:a.query({query:()=>"lead/list"}),deleteLead:a.mutation({query:e=>({url:`lead/${e}`,method:"DELETE"})}),convertLeadToCustomer:a.mutation({query:({id:e,...t})=>({url:`lead/${e}/convert-to-customer`,method:"POST",body:t})}),assignLead:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/assign`,method:"POST",body:t}),invalidatesTags:["Lead"]}),markLeadQualified:a.mutation({query:({id:e,reason:t})=>({url:`lead/${e}/mark-qualified`,method:"POST",body:t??""}),invalidatesTags:["Lead"]}),markLeadLost:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/mark-lost`,method:"POST",body:t}),invalidatesTags:["Lead"]}),updateLeadStatus:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/status`,method:"PATCH",body:t}),invalidatesTags:["Lead"]}),getLeadTimeline:a.query({query:e=>`lead/${e}/timeline`,providesTags:["LeadActivity"]}),getLeadDashboard:a.query({query:()=>"lead/dashboard",providesTags:["Lead"]}),linkLeadQuotation:a.mutation({query:({leadId:e,...t})=>({url:`lead/${e}/link-quotation`,method:"POST",body:t})}),getLeadAssignmentHistory:a.query({query:e=>`lead/${e}/assignment-history`,providesTags:["Lead"]}),resolveQuotationAddresses:a.query({query:({sourceType:e,sourceId:t,customerId:o})=>{const s=new URLSearchParams({sourceType:e});return t!=null&&s.set("sourceId",String(t)),o!=null&&s.set("customerId",String(o)),`quotation/addresses?${s.toString()}`}})}),overrideExisting:!1}),{useSaveLeadDetailsMutation:i,useUpdateLeadDetailsMutation:n,useGetLeadByIdQuery:y,useLazyGetLeadByIdQuery:L,useGetLeadFullByIdQuery:l,useLazyGetLeadFullByIdQuery:m,useGetLeadsByPageMutation:h,useGetLeadsByPageForAcMutation:g,useSearchLeadsForArtApprovalMutation:q,useSearchLeadsForFollowUpMutation:c,useSearchLeadsForCostEstimationMutation:p,useSearchLeadsForQuotationMutation:T,useSearchLeadsForOrderMutation:S,useRejectLeadQuotationMutation:P,useGetLeadListQuery:v,useDeleteLeadMutation:Q,useConvertLeadToCustomerMutation:M,useAssignLeadMutation:f,useMarkLeadQualifiedMutation:F,useMarkLeadLostMutation:A,useUpdateLeadStatusMutation:O,useGetLeadTimelineQuery:$,useLazyGetLeadTimelineQuery:z,useGetLeadDashboardQuery:G,useLinkLeadQuotationMutation:k,useGetLeadAssignmentHistoryQuery:B,useLazyGetLeadAssignmentHistoryQuery:C,useLazyResolveQuotationAddressesQuery:D}=r;export{Q as a,i as b,n as c,f as d,g as e,m as f,q as g,G as h,l as i,p as j,S as k,D as l,$ as m,B as n,M as o,F as p,A as q,k as r,T as s,P as t,h as u,c as v};
