import{Nt as e}from"./branding-B7dW-jsD.js";import{f as t,h as n,m as r,p as i}from"./index-B6j-NK0t.js";import{t as a}from"./badge-S6iHGjk-.js";function o(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function s(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function c(e,t=1){return`${e.toFixed(t)}%`}function l(e){return e===0?`$0`:`$${e.toFixed(2)}`}var u=e();function d({status:e}){let t=e=>{switch(e){case`pending`:return`bg-[var(--status-pending-bg)] text-[var(--status-pending-fg)] border-[var(--status-pending-border)]`;case`running`:return`bg-[var(--status-running-bg)] text-[var(--status-running-fg)] border-[var(--status-running-border)] animate-pulse`;case`completed`:return`bg-[var(--status-completed-bg)] text-[var(--status-completed-fg)] border-[var(--status-completed-border)]`;case`failed`:return`bg-[var(--status-failed-bg)] text-[var(--status-failed-fg)] border-[var(--status-failed-border)]`;case`retrying`:return`bg-[var(--status-retrying-bg)] text-[var(--status-retrying-fg)] border-[var(--status-retrying-border)]`;case`awaiting_approval`:return`bg-[var(--status-awaiting-bg)] text-[var(--status-awaiting-fg)] border-[var(--status-awaiting-border)] animate-pulse`;case`rejected`:return`bg-[var(--status-rejected-bg)] text-[var(--status-rejected-fg)] border-[var(--status-rejected-border)]`;case`cancelled`:case`skipped`:return`bg-[var(--status-cancelled-bg)] text-[var(--status-cancelled-fg)] border-[var(--status-cancelled-border)]`;default:return e}},n=o(e);return(0,u.jsx)(a,{variant:`outline`,className:`text-[11px] font-medium uppercase tracking-wide tabular-nums ${t(e)}`,children:n})}function f(e){switch(e.kind){case`manual`:return{label:`Manual`,tooltip:null};case`webhook`:return{label:`Webhook`,tooltip:e.path};case`cron`:return{label:`Cron`,tooltip:e.schedule};case`api`:return{label:`API`,tooltip:null};case`retry`:return{label:`Retry`,tooltip:e.parent_run_id};case`workflow`:return{label:`Workflow`,tooltip:null};default:return e}}function p({trigger:e}){let{label:o,tooltip:s}=f(e);return s?(0,u.jsx)(r,{delay:200,children:(0,u.jsxs)(t,{children:[(0,u.jsx)(n,{render:(0,u.jsx)(a,{variant:`outline`,className:`font-mono text-[10px]`,children:o})}),(0,u.jsx)(i,{side:`bottom`,children:(0,u.jsx)(`span`,{className:`font-mono text-xs`,children:s})})]})}):(0,u.jsx)(a,{variant:`outline`,className:`font-mono text-[10px]`,children:o})}export{s as a,l as i,d as n,c as o,o as r,p as t};