function e(e){return`/api/projects/${encodeURIComponent(e)}/recurring-tasks`}async function t(e){let t=await e.json().catch(()=>null);if(!e.ok){let n=t?.error||t?.message||`HTTP ${e.status}`;throw Error(n)}return t}async function n(n){return fetch(e(n)).then(e=>t(e))}async function r(n,r,i=100,a=0){let o=`${e(n)}/${encodeURIComponent(r)}/runs?limit=${Math.max(1,Math.min(200,i))}&offset=${Math.max(0,Math.round(a))}`;return fetch(o).then(e=>t(e))}async function i(n,r){return fetch(e(n),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}).then(e=>t(e))}async function a(n,r,i){return fetch(`${e(n)}/${encodeURIComponent(r)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)}).then(e=>t(e))}async function o(n,r){return fetch(`${e(n)}/${encodeURIComponent(r)}`,{method:`DELETE`}).then(e=>t(e))}function s(e){return e?e===`queued`||e===`starting`?{label:`Starting`,tone:`live`}:e===`running`?{label:`Running`,tone:`live`}:e===`awaiting_approval`?{label:`Needs approval`,tone:`approval`}:e===`completed`?{label:`Completed`,tone:`good`}:e===`stopped`?{label:`Stopped`,tone:`wait`}:e===`skipped`?{label:`Skipped`,tone:`wait`}:e===`cancelled`?{label:`Cancelled`,tone:`wait`}:e===`failed`||e===`error`?{label:`Failed`,tone:`bad`}:{label:e.replace(/_/g,` `),tone:`quiet`}:{label:`No runs`,tone:`quiet`}}export{s as a,n as i,o as n,a as o,r,i as t};