import{u as s}from"./useQuery-PdiC7-sY.js";import{a as i,b as l,o as a}from"./index-O0BQoyzo.js";const r={all:["heartbeat"],list:["heartbeat","list"]};function c(e){return`${e.platform}:${e.channelId}:${e.threadId}`}function g(){return s({queryKey:r.list,queryFn:()=>a.get("/api/heartbeat/bindings"),refetchInterval:1e4,refetchIntervalInBackground:!1})}function p(){const e=i();return l({mutationFn:({row:t,op:n})=>a.post(`/api/heartbeat/bindings/${encodeURIComponent(c(t))}/${n}`),onSuccess:()=>e.invalidateQueries({queryKey:r.all})})}const u={all:["goals"],list:["goals","list"]};function h(){return s({queryKey:u.list,queryFn:()=>a.get("/api/goals"),refetchInterval:3e4})}function m(){const e=i();return l({mutationFn:({id:t,status:n})=>a.put(`/api/goals/${t}/status`,{body:{status:n}}),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}const o={all:["asks"],list:["asks","list"]};function q(){return s({queryKey:o.list,queryFn:()=>a.get("/api/asks/pending"),refetchInterval:5e3})}function K(){const e=i();return l({mutationFn:t=>a.post(`/api/asks/pending/${encodeURIComponent(t)}/cancel`),onSuccess:()=>e.invalidateQueries({queryKey:o.all})})}const y={all:["plans"],list:(e,t)=>["plans","list",e??null,t??null]};function b(e={}){const t=new URLSearchParams;e.threadKey&&t.set("thread_key",e.threadKey),e.limit!=null&&t.set("limit",String(e.limit));const n=t.toString();return s({queryKey:y.list(e.threadKey,e.limit),queryFn:()=>a.get(`/api/plans${n?`?${n}`:""}`)})}export{p as a,h as b,m as c,q as d,K as e,b as f,g as u};
//# sourceMappingURL=use-background-tasks-BQrEeUwY.js.map
