import{t as e}from"./createLucideIcon-CPi6oOk3.js";import{_ as t}from"./vendor-flow-IzlrcDx6.js";import{t as n}from"./Input-DAV_OJ97.js";import{t as r}from"./Dropdown-BZh579Ix.js";import{t as i}from"./Checkbox-CAhHfvYx.js";import{z as a}from"./workflowRtkApi-Csqv-DAI.js";var o=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),s=e(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),c=t(),l=[{value:`manual`,label:`Manual`},{value:`automatic`,label:`Automatic`},{value:`scheduled`,label:`Scheduled`},{value:`event_based`,label:`Event Based`}],u=[{value:`header`,label:`Header Level`},{value:`item`,label:`Item Level`}];function d({title:e,children:t}){return(0,c.jsxs)(`section`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,c.jsx)(`h3`,{className:`mb-3 text-[12px] font-semibold uppercase tracking-[0.04em] text-[var(--color-text-secondary)]`,children:e}),t]})}function f({value:e,onChange:t,errors:o={},modelOptions:s,modelsLoading:f,codeMode:p=`hidden`}){return(0,c.jsxs)(`div`,{className:`divide-y divide-[var(--color-border-light)]`,children:[(0,c.jsx)(d,{title:`Basics`,children:(0,c.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,c.jsx)(n,{label:`Workflow Name *`,value:e.workflow_name,onChange:e=>t(`workflow_name`,e.target.value),placeholder:`e.g. Loan Application Approval`,error:o.workflow_name}),p===`readonly`&&(0,c.jsx)(n,{label:`Workflow Code`,value:e.workflow_code,disabled:!0,hint:`Auto-generated; cannot be changed.`}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(a,{htmlFor:`content_type`,children:`Business Object *`}),(0,c.jsx)(r,{id:`content_type`,value:e.content_type,onChange:e=>t(`content_type`,e),options:s,placeholder:f?`Loading…`:`Select business object`,searchable:!0,error:o.content_type,hint:`The model this workflow applies to.`})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(a,{htmlFor:`trigger_type`,children:`Trigger Type`}),(0,c.jsx)(r,{id:`trigger_type`,value:e.trigger_type,onChange:e=>t(`trigger_type`,e),options:l})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(a,{htmlFor:`approval_level`,children:`Approval Level`}),(0,c.jsx)(r,{id:`approval_level`,value:e.approval_level,onChange:e=>t(`approval_level`,e),options:u,hint:`Header: entire document approved at once. Item: each item approved separately.`})]})]})}),(0,c.jsx)(d,{title:`SLA & Escalation`,children:(0,c.jsxs)(`div`,{className:`grid grid-cols-1 items-end gap-4 md:grid-cols-3`,children:[(0,c.jsx)(n,{label:`SLA (hours)`,type:`number`,value:e.sla_hours,onChange:e=>t(`sla_hours`,e.target.value),placeholder:`e.g. 24`}),(0,c.jsx)(n,{label:`Escalate after (hours)`,type:`number`,value:e.escalation_hours,onChange:e=>t(`escalation_hours`,e.target.value),placeholder:`e.g. 8`,disabled:!e.enable_escalation}),(0,c.jsx)(`div`,{className:`pb-2.5`,children:(0,c.jsx)(i,{label:`Enable escalation`,checked:e.enable_escalation,onChange:e=>t(`enable_escalation`,e.target.checked)})})]})})]})}export{s as n,o as r,f as t};