import{__assign as i}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as t}from"react";import{ConditionSection as o}from"../../organisms/ConditionSection/ConditionSection.js";import{TextSection as l}from"../../organisms/TextSection/TextSection.js";var r=function(r){var d,s,u,a=r.state,p=r.handlers,h=r.uiState,g=(null==h?void 0:h.highlights)||{},c=t({}),v=c[0],y=c[1],m=function(e){y(function(n){var t;return i(i({},n),((t={})[e]=!n[e],t))})},A=function(i){var e,n=null===(e=a.fieldCitations)||void 0===e?void 0:e[i];return Array.isArray(n)&&n.length>0?n:a.citations};return e("div",i({className:"simple-guideline-template"},{children:n("div",i({style:{display:"flex",flexDirection:"column",gap:"20px"}},{children:[e(l,i({id:"guideline-title",title:"Guideline Title",rows:1,placeholder:"Enter a short, descriptive title for the guideline",required:!0,value:a.guidelineTitle,onChange:p.setGuidelineTitle,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineTitle,onToggle:function(){return m("guidelineTitle")},isHighlighted:g.guidelineTitle||!1,tooltipDescription:"Why this Title?",errorMessage:null===(d=null==h?void 0:h.validationErrors)||void 0===d?void 0:d.guidelineTitle},h)),e(l,i({id:"guideline-description",title:"Guideline Description",rows:4,placeholder:"Describe what this guideline enforces or ensures",required:!0,value:a.guidelineDescription,onChange:p.setGuidelineDescription,readOnly:null==h?void 0:h.isAiStreaming,isOpen:v.guidelineDescription,onToggle:function(){return m("guidelineDescription")},isHighlighted:g.guidelineDescription||!1,tooltipDescription:"Why this Description?",errorMessage:null===(s=null==h?void 0:h.validationErrors)||void 0===s?void 0:s.guidelineDescription},h)),e(o,i({id:"when-to-apply",title:"When to apply",required:!0,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenToApplyConditions||[],onAdd:function(){return p.addWhenToApply()},onRemove:function(i,e,n){return p.removeWhenToApply(n)},onEdit:function(i,e,n,t){return p.editWhenToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenToApply"),bordered:!0,addLabel:"Add When to apply",isAiStreaming:null==h?void 0:h.isAiStreaming,errorMessage:null===(u=null==h?void 0:h.validationErrors)||void 0===u?void 0:u.whenToApply},h)),e(o,i({id:"when-not-to-apply",title:"When NOT to apply",required:!1,dividerRequired:!0,readOnly:null==h?void 0:h.isAiStreaming,conditions:a.whenNotToApplyConditions||[],onAdd:function(){return p.addWhenNotToApply()},onRemove:function(i,e,n){return p.removeWhenNotToApply(n)},onEdit:function(i,e,n,t){return p.editWhenNotToApply(n,t)},index:0,tierKey:"default",isHighlighted:g.wnta||!1,highlightedIds:null==h?void 0:h.highlightedIds,tooltipDescription:"Why this Condition?",citations:A("whenNotToApply"),bordered:!0,addLabel:"Add When NOT to apply",isAiStreaming:null==h?void 0:h.isAiStreaming},h))]}))}))};export{r as WorkflowComposer};
//# sourceMappingURL=WorkflowComposer.js.map
