import{t as e}from"./createLucideIcon-CPi6oOk3.js";import{t}from"./circle-check-BqIK9ymt.js";import{t as n}from"./link-2-BddEFn3I.js";import{t as r}from"./play-ArREtMRx.js";import{t as i}from"./zap-gFz3AQAA.js";import{Vn as a,qn as o,zn as s}from"./index-HkVQGc9M.js";var c=e(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),l=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),u={START:`start`,APPROVAL:`approval`,TASK:`task`,DECISION:`decision`,PARALLEL:`parallel`,JOIN:`join`,END:`end`,NOTIFICATION:`notification`,CALL_WORKFLOW:`call_workflow`},d=[{type:u.START,label:`Start`,icon:r,description:`Starting point of the workflow`,group:`Flow control`,iconColor:`text-emerald-600 dark:text-emerald-400`,chipBg:`bg-emerald-50 dark:bg-emerald-950/40`,barBg:`bg-emerald-500`},{type:u.DECISION,label:`Decision`,icon:s,description:`Conditional branching`,group:`Flow control`,iconColor:`text-amber-600 dark:text-amber-400`,chipBg:`bg-amber-50 dark:bg-amber-950/40`,barBg:`bg-amber-500`},{type:u.PARALLEL,label:`Parallel`,icon:i,description:`Execute multiple paths in parallel`,group:`Flow control`,iconColor:`text-orange-600 dark:text-orange-400`,chipBg:`bg-orange-50 dark:bg-orange-950/40`,barBg:`bg-orange-500`},{type:u.JOIN,label:`Join`,icon:n,description:`Synchronize parallel paths`,group:`Flow control`,iconColor:`text-teal-600 dark:text-teal-400`,chipBg:`bg-teal-50 dark:bg-teal-950/40`,barBg:`bg-teal-500`},{type:u.END,label:`End`,icon:l,description:`End point of the workflow`,group:`Flow control`,iconColor:`text-rose-600 dark:text-rose-400`,chipBg:`bg-rose-50 dark:bg-rose-950/40`,barBg:`bg-rose-500`},{type:u.APPROVAL,label:`Approval`,icon:t,description:`Requires user/role approval`,group:`Actions`,iconColor:`text-blue-600 dark:text-blue-400`,chipBg:`bg-blue-50 dark:bg-blue-950/40`,barBg:`bg-blue-500`},{type:u.TASK,label:`Task`,icon:a,description:`Manual task to complete`,group:`Actions`,iconColor:`text-violet-600 dark:text-violet-400`,chipBg:`bg-violet-50 dark:bg-violet-950/40`,barBg:`bg-violet-500`},{type:u.NOTIFICATION,label:`Notification`,icon:o,description:`Send a notification to users`,group:`Actions`,iconColor:`text-pink-600 dark:text-pink-400`,chipBg:`bg-pink-50 dark:bg-pink-950/40`,barBg:`bg-pink-500`},{type:u.CALL_WORKFLOW,label:`Call Workflow`,icon:c,description:`Invoke another workflow as a sub-process`,group:`Actions`,iconColor:`text-indigo-600 dark:text-indigo-400`,chipBg:`bg-indigo-50 dark:bg-indigo-950/40`,barBg:`bg-indigo-500`}],f=[`Flow control`,`Actions`],p=d.reduce((e,t)=>(e[t.type]=t,e),{});function m(e){return{start:`Start`,end:`End`,approval:`Approval`,task:`Task`,decision:`Decision`,parallel:`Parallel Gateway`,join:`Join`,notification:`Notification`,call_workflow:`Call Workflow`}[e.toLowerCase()]||e}function h(e,t){return{nodes:e.map(e=>({id:e.id,type:e.step_type,label:e.step_name,data:e})),edges:t.map(e=>({id:e.id,source:e.from_step,target:e.to_step,label:e.transition_name,data:e}))}}function g(e){let t=e.workflow_definition;return t?.nodes&&t.nodes.length>0?{steps:t.nodes.map(e=>{let t=e.data||e;return{...t,id:e.id||t.id,position:t.position||{x:0,y:0}}}),transitions:(t.edges||[]).map(e=>{let t=e.data||e;return{...t,id:e.id||t.id,from_step:e.source||t.from_step,to_step:e.target||t.to_step}})}:{steps:e.steps??[],transitions:e.transitions??[]}}export{p as a,d as i,g as n,m as o,f as r,u as s,h as t};