import{u as a}from"./vendor-query-B2UbickB.js";import{b as t}from"./index-BZu5zewH.js";function y(e){const s=new URLSearchParams;return e.status&&s.set("status",e.status),e.lt_type&&s.set("lt_type",e.lt_type),e.workflow_type&&s.set("workflow_type",e.workflow_type),e.origin_id&&s.set("origin_id",e.origin_id),e.limit&&s.set("limit",String(e.limit)),e.offset!==void 0&&s.set("offset",String(e.offset)),a({queryKey:["tasks",e],queryFn:()=>t(`/tasks?${s}`)})}function c(e){return a({queryKey:["tasks",e],queryFn:()=>t(`/tasks/${e}`),enabled:!!e})}function k(e){return a({queryKey:["tasks","children",e],queryFn:()=>t(`/tasks?parent_workflow_id=${encodeURIComponent(e)}&limit=50`),enabled:!!e})}function r(e){return a({queryKey:["tasks","byWorkflow",e],queryFn:async()=>{const s=await t(`/tasks?workflow_id=${encodeURIComponent(e)}&limit=1`);return s.tasks.length>0?s.tasks[0]:(await t(`/tasks?parent_workflow_id=${encodeURIComponent(e)}&limit=1`)).tasks[0]??null},enabled:!!e})}function p(e){const s=new URLSearchParams;return e!=null&&e.limit&&s.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&s.set("offset",String(e.offset)),e!=null&&e.workflow_type&&s.set("workflow_type",e.workflow_type),e!=null&&e.status&&s.set("status",e.status),e!=null&&e.search&&s.set("search",e.search),a({queryKey:["processes",e],queryFn:()=>t(`/tasks/processes?${s}`)})}function m(e){return a({queryKey:["processes",e],queryFn:()=>t(`/tasks/processes/${encodeURIComponent(e)}`),enabled:!!e,retry:3,retryDelay:1e3})}export{m as a,r as b,y as c,c as d,k as e,p as u};
//# sourceMappingURL=tasks-BQ1c7trT.js.map
