import{t as e}from"./api-DAEUkJit.js";var{useGetNodeTypesQuery:t,useListFlowsQuery:n,useGetFlowQuery:r,useCreateFlowMutation:i,useUpdateFlowMutation:a,useSaveDraftMutation:o,usePublishFlowMutation:s,useListFlowVersionsQuery:c,useRevertFlowMutation:l,useDuplicateFlowMutation:u,useArchiveFlowMutation:d,useSimulateMutation:f,useListConversationsQuery:p,useGetConversationQuery:m,useSendConversationMessageMutation:h,useCloseConversationMutation:g,useGetAnalyticsQuery:_,useListCampaignsQuery:v,useGetCampaignQuery:y,useCreateCampaignMutation:b,usePreviewAudienceMutation:x,useSendCampaignMutation:S,useGetCampaignRecipientsQuery:C}=e.injectEndpoints({endpoints:e=>({getNodeTypes:e.query({query:()=>`/whatsapp/node-types/`,providesTags:[{type:`WaNodeType`,id:`LIST`}]}),listFlows:e.query({query:e=>({url:`/whatsapp/flows/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`WaFlow`,id:e})),{type:`WaFlow`,id:`LIST`}]:[{type:`WaFlow`,id:`LIST`}]}),getFlow:e.query({query:e=>`/whatsapp/flows/${e}/`,providesTags:(e,t,n)=>[{type:`WaFlow`,id:n}]}),createFlow:e.mutation({query:e=>({url:`/whatsapp/flows/`,method:`POST`,body:e}),invalidatesTags:[{type:`WaFlow`,id:`LIST`}]}),updateFlow:e.mutation({query:({id:e,body:t})=>({url:`/whatsapp/flows/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`WaFlow`,id:n},{type:`WaFlow`,id:`LIST`}]}),saveDraft:e.mutation({query:({id:e,graph:t})=>({url:`/whatsapp/flows/${e}/draft/`,method:`PUT`,body:{graph:t}}),invalidatesTags:(e,t,{id:n})=>[{type:`WaFlow`,id:n}]}),publishFlow:e.mutation({query:({id:e,note:t})=>({url:`/whatsapp/flows/${e}/publish/`,method:`POST`,body:{note:t}}),invalidatesTags:(e,t,{id:n})=>[{type:`WaFlow`,id:n},{type:`WaFlow`,id:`LIST`},{type:`WaFlowVersion`,id:n}]}),listFlowVersions:e.query({query:e=>`/whatsapp/flows/${e}/versions/`,providesTags:(e,t,n)=>[{type:`WaFlowVersion`,id:n}]}),revertFlow:e.mutation({query:({id:e,version:t})=>({url:`/whatsapp/flows/${e}/revert/`,method:`POST`,body:{version:t}}),invalidatesTags:(e,t,{id:n})=>[{type:`WaFlow`,id:n}]}),duplicateFlow:e.mutation({query:e=>({url:`/whatsapp/flows/${e}/duplicate/`,method:`POST`}),invalidatesTags:[{type:`WaFlow`,id:`LIST`}]}),archiveFlow:e.mutation({query:e=>({url:`/whatsapp/flows/${e}/archive/`,method:`POST`}),invalidatesTags:(e,t,n)=>[{type:`WaFlow`,id:n},{type:`WaFlow`,id:`LIST`}]}),simulate:e.mutation({query:({id:e,...t})=>({url:`/whatsapp/flows/${e}/simulate/`,method:`POST`,body:t})}),listConversations:e.query({query:e=>({url:`/whatsapp/conversations/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`WaConversation`,id:e})),{type:`WaConversation`,id:`LIST`}]:[{type:`WaConversation`,id:`LIST`}]}),getConversation:e.query({query:e=>`/whatsapp/conversations/${e}/`,providesTags:(e,t,n)=>[{type:`WaConversation`,id:n}]}),sendConversationMessage:e.mutation({query:({id:e,body:t})=>({url:`/whatsapp/conversations/${e}/send/`,method:`POST`,body:{body:t}}),invalidatesTags:(e,t,{id:n})=>[{type:`WaConversation`,id:n},{type:`WaConversation`,id:`LIST`}]}),closeConversation:e.mutation({query:e=>({url:`/whatsapp/conversations/${e}/close/`,method:`POST`}),invalidatesTags:(e,t,n)=>[{type:`WaConversation`,id:n},{type:`WaConversation`,id:`LIST`}]}),getAnalytics:e.query({query:e=>({url:`/whatsapp/analytics/`,params:{days:String(e||30)}}),providesTags:[{type:`WaAnalytics`,id:`SUMMARY`}]}),listCampaigns:e.query({query:e=>({url:`/whatsapp/campaigns/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`WaCampaign`,id:e})),{type:`WaCampaign`,id:`LIST`}]:[{type:`WaCampaign`,id:`LIST`}]}),getCampaign:e.query({query:e=>`/whatsapp/campaigns/${e}/`,providesTags:(e,t,n)=>[{type:`WaCampaign`,id:n}]}),createCampaign:e.mutation({query:e=>({url:`/whatsapp/campaigns/`,method:`POST`,body:e}),invalidatesTags:[{type:`WaCampaign`,id:`LIST`}]}),previewAudience:e.mutation({query:e=>({url:`/whatsapp/campaigns/preview-audience/`,method:`POST`,body:{audience:e}})}),sendCampaign:e.mutation({query:({id:e,scheduled_at:t})=>({url:`/whatsapp/campaigns/${e}/send/`,method:`POST`,body:{scheduled_at:t}}),invalidatesTags:(e,t,{id:n})=>[{type:`WaCampaign`,id:n},{type:`WaCampaign`,id:`LIST`}]}),getCampaignRecipients:e.query({query:({id:e,params:t})=>({url:`/whatsapp/campaigns/${e}/recipients/`,params:t||void 0}),providesTags:(e,t,{id:n})=>[{type:`WaCampaign`,id:n}]})})});export{a as S,l as _,u as a,h as b,m as c,v as d,p as f,s as g,x as h,i,r as l,n as m,g as n,_ as o,c as p,b as r,C as s,d as t,t as u,o as v,f as x,S as y};