easy_flow 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/builds/easy_flow/canvas.js +1 -1
- data/app/javascript/easy_flow/canvas/Control.jsx +8 -1
- data/app/javascript/easy_flow/canvas/Inspector.jsx +1 -1
- data/app/models/easy_flow/settings.rb +5 -1
- data/app/models/easy_flow/step_type/declaration.rb +1 -1
- data/lib/easy_flow/version.rb +1 -1
- data/lib/easy_flow.rb +1 -1
- data/the_local/agents/easy_flow-develop.md +1 -1
- data/the_local/agents/easy_flow-info.md +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a64183f5e338cb3950e9f77d3165834a939dee76067f5cf4cd567e4ca2e40144
|
|
4
|
+
data.tar.gz: b5878c5007128011c23d43bc3aeaeeee8b13e79856f7c061ab01de7a61894745
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a68b07005457be0dc468f418ae95cda4bf89f87951cb7ac2b9b3c086f42baa2fd390fcae62f3882e8678428952634c9448e471883ad582e76c001591d95ec20
|
|
7
|
+
data.tar.gz: 738d0e6babe2dfd388381d0224615a3deefa630b2a2dd6084793184f7e1b9a1095c97963afaeac8dbb9139bc66eb0f93019832b49067b7e858ec5662f3077cc7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var Ce=globalThis.ReactDOM;var{createPortal:Zo,createRoot:ft,flushSync:Ro,hydrateRoot:tr,preconnect:er,prefetchDNS:or,preinit:rr,preinitModule:nr,preload:sr,preloadModule:ar,requestFormReset:ir,unstable_batchedUpdates:lr,useFormState:dr,useFormStatus:cr,version:pr}=Ce;var gt=globalThis.React,o=gt,{Children:mr,Component:fr,Fragment:gr,PureComponent:hr,StrictMode:yr,Suspense:xr,cloneElement:br,createContext:vr,createElement:wr,createRef:kr,forwardRef:Sr,isValidElement:Cr,lazy:Nr,memo:zr,startTransition:Br,useCallback:Tr,useContext:Er,useDebugValue:_r,useDeferredValue:Dr,useEffect:L,useId:Ar,useImperativeHandle:Or,useLayoutEffect:ht,useMemo:j,useReducer:Pr,useRef:et,useState:S,useSyncExternalStore:$r,useTransition:Lr}=gt;var yt=new Map,V=new Map,ot=(t,e)=>yt.set(t,e),xt=()=>{V.forEach(t=>t.unmount()),V.clear()},bt=(t,e)=>t.querySelectorAll("[data-react-ui]").forEach(n=>{if(V.has(n))return;let r=yt.get(n.dataset.reactUi),a=e(n);V.set(n,a),a.render(o.createElement(r,JSON.parse(n.dataset.props)))});var vt=(t,e)=>{let n=()=>bt(t,e);t.addEventListener("turbo:load",n),t.addEventListener("turbo:frame-load",n),t.addEventListener("turbo:before-cache",xt),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",n):n()};var E=(...t)=>t.filter(Boolean).join(" ");var Ne={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},ze={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},Be=({variant:t="primary",size:e="md",className:n,children:r,...a})=>{let l=a.href?"a":"button";return o.createElement(l,{...a,className:E("ks-button",Ne[t],ze[e],n)},r)},v=Be;var Te="border border-amber-500 bg-white text-amber-700 dark:bg-zinc-900 dark:text-amber-400",Ee="border border-gray-300 bg-white text-gray-500 dark:border-zinc-600 dark:bg-zinc-900 dark:text-gray-400",_e="border border-accent-600 bg-accent-600 text-white",De=({name:t,connected:e,armed:n,onArm:r,connecting:a})=>o.createElement("button",{onClick:l=>{a||(l.stopPropagation(),r(l))},title:n?"Now choose a step to connect to":"Connect this branch",className:n?_e:e?Ee:Te,style:{padding:"1px 8px",marginRight:4,borderRadius:999,fontSize:11,cursor:"pointer"}},t||"next"),wt=De;var Ae={width:240,boxSizing:"border-box",borderRadius:8},Oe={minWidth:120,boxSizing:"border-box",borderRadius:6},Pe={padding:"8px 14px",textAlign:"center",fontWeight:600},$e={fontWeight:600,lineHeight:1.3},Le={fontSize:12,fontWeight:500,lineHeight:1.3},Ie=(t,e,n)=>{let r=n?"ring-4 ring-accent-600/15":"shadow-sm";return t||n&&!e?`border-accent-600 ${r}`:e?`border-red-600 ${r}`:"border-gray-300 shadow-sm dark:border-zinc-700"},Me=(t,e)=>e&&t.label===t.id&&t.type_name||t.label,je=(t,e,n)=>n?e===t.type_name?null:t.type_name:t.type,He=({node:t,selected:e,armed:n,connecting:r,onSelect:a,onOpen:l,onArm:d,onDragEnd:i,onDragStart:p,hideStepTypeCodes:h,branches:b=[],compact:m=!1,typeAbove:g=m})=>{let f=t.begins_here||t.ends_here,u=t.begins_here,k=t.ends_here?[]:t.ports,w=r&&!u,C=Me(t,h),T=je(t,C,h);return o.createElement("div",{ref:t.ref,"data-step":t.id,draggable:!u,onDragStart:x=>{x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",t.id),p()},onDragEnd:i,onClick:t.opens&&!r?()=>l(t.opens):a,className:`bg-white ${m&&!e?"border":"border-2"} dark:bg-zinc-900 ${Ie(w,t.violations.length>0,e)}`,style:{...m?Oe:Ae,padding:f?0:m?"8px 10px":"12px 14px",cursor:u?"default":r?"crosshair":"grab"}},!f&&g&&T&&o.createElement("div",{className:"font-mono text-gray-500 dark:text-gray-400",style:{fontSize:11}},T),f&&o.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:Pe},C),!f&&o.createElement("div",{style:m?Le:$e},C),t.violations.length>0&&o.createElement("div",{"data-error-count":!0,className:"text-red-600 dark:text-red-400",style:{fontSize:10}},`${t.violations.length} error${t.violations.length===1?"":"s"}`),!f&&t.summary&&t.violations.length===0&&o.createElement("div",{className:e?"text-accent-600 dark:text-accent-400":"text-gray-500 dark:text-gray-400",style:{fontSize:10}},t.summary),!f&&!g&&T&&o.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginTop:2}},T),t.picture_url&&o.createElement("div",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:11,marginTop:2}},"Has a picture"),t.starts_a_flow&&o.createElement("div",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:11,marginTop:2}},"Runs a flow"),t.opens&&o.createElement(v,{variant:"secondary",size:"sm",className:"mt-2",onClick:x=>{x.stopPropagation(),a()}},"Settings"),b.map(x=>o.createElement("div",{key:x,className:"text-gray-500 dark:text-gray-400",style:{fontSize:10}},x)),k.length>0&&o.createElement("div",{style:{padding:t.begins_here?"0 14px 8px":"10px 0 0"}},k.map(x=>o.createElement(wt,{key:x,name:x,connected:t.connected.includes(x),connecting:r,armed:n===x,onArm:y=>d(x,y)}))))},rt=He;var kt={position:"relative",zIndex:2,width:240,fontSize:11,whiteSpace:"nowrap",cursor:"pointer"},We={...kt,width:"auto",whiteSpace:"normal",overflowWrap:"anywhere"},Fe=({node:t,header:e,onSelect:n,compact:r=!1})=>o.createElement("div",{ref:t.ref,"data-group-header":t.id,onClick:n,className:"font-mono text-gray-500 dark:text-gray-400",style:{...r?We:kt,...n?{}:{cursor:"default"}}},e),Y=Fe;var Ve=({id:t,bounds:e,onDrop:n})=>o.createElement("div",{"data-group-box":t,onDragOver:r=>{r.preventDefault(),r.dataTransfer.dropEffect="move"},onDrop:r=>{r.preventDefault(),n()},className:"border border-dashed border-gray-400 bg-white/60 dark:border-zinc-600 dark:bg-zinc-900/60",style:{position:"absolute",zIndex:1,borderRadius:8,boxSizing:"border-box",...e}}),St=Ve;var Ye=t=>t!=null&&t!==""&&typeof t!="object",Ue=["integer","float"],Ge=(t,e,n)=>n&&e.labels?.[t]||t,U=(t,e,n)=>{let r=Object.keys(e?.fields||{}).filter(a=>Ye(t.config[a])).map(a=>`${Ge(a,e,n)}${Ue.includes(e.fields[a])?"":":"} ${t.config[a]}`);return[n&&t.type_name||t.type,...r].join(" \xB7 ")};var Ct=(t,e,n)=>{let r=Math.min(...t.map(i=>i.left))-e.left+n.scrollLeft-12,a=Math.min(...t.map(i=>i.top))-e.top+n.scrollTop-10,l=Math.max(...t.map(i=>i.left+i.width))-e.left+n.scrollLeft+12,d=Math.max(...t.map(i=>i.top+i.height))-e.top+n.scrollTop+10;return{left:r,top:a,width:l-r,height:d-a}},Xe=({left:t,top:e,width:n,height:r},a)=>a.x>=t&&a.x<=t+n&&a.y>=e&&a.y<=e+r,Nt=(t,e)=>t.find(n=>Xe(n.bounds,e))?.id||null,zt=(t,e)=>t.filter(n=>!e.some(r=>r.id===n.source&&r.holds?.includes(n.target))),Bt=(t,e)=>e.some(n=>n.holds?.includes(t.id)&&!n.loose&&n.row===t.row-1);var nt=(t,e)=>t.includes(e)?t.filter(n=>n!==e):[...t,e],Tt=(t,e)=>({...e?.choices||{},...t?.choices||{}});var qe=({as:t="input",disabled:e,className:n,...r})=>o.createElement(t,{...r,disabled:e,className:E("ks-input",e&&"ks-input-disabled",n)}),A=qe;var Je=t=>o.createElement(A,{...t,as:"select"}),Et=Je;var Ke=({className:t,...e})=>o.createElement("input",{type:"checkbox",...e,className:E("ks-checkbox",t)}),G=Ke;var _t=t=>(t||[]).map(e=>typeof e=="object"?e:{value:e,label:e}),Qe=({type:t,value:e,choices:n,onChange:r,onSettle:a,onPick:l,pictureUrl:d})=>{if(t==="picture")return o.createElement("div",{className:"mb-3"},e&&d&&o.createElement("img",{src:d,alt:"The step's picture",style:{maxWidth:"100%"}}),e&&o.createElement("button",{type:"button","data-remove-picture":!0,className:"ks-button ks-button-secondary ks-button-sm",onClick:()=>a("")},"Remove picture"),o.createElement("input",{type:"file",accept:"image/*",onChange:i=>i.target.files[0]&&l(i.target.files[0])}));if(t==="boolean")return o.createElement(G,{checked:!!e,onChange:i=>a(i.target.checked)});if(t==="select"||t==="previous_step"||t==="from_step"||t==="flow")return o.createElement(Et,{className:"mb-3",value:e??"",onChange:i=>a(i.target.value)},o.createElement("option",{value:""}),_t(n).map(i=>o.createElement("option",{key:i.value,value:i.value},i.label)));if(t==="multi_select"){let i=Array.isArray(e)?e:[],p=h=>a(nt(i,h));return o.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:8}},(n||[]).map(h=>o.createElement("label",{key:h,style:{display:"inline-flex",alignItems:"center",gap:4}},o.createElement(G,{checked:i.includes(h),onChange:()=>p(h)}),o.createElement("span",null,h))))}if(t==="flows"){let i=Array.isArray(e)?e:[];return o.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4},className:"mb-3"},_t(n).map(p=>o.createElement("label",{key:p.value,style:{display:"inline-flex",alignItems:"center",gap:4}},o.createElement(G,{checked:i.includes(p.value),onChange:()=>a(nt(i,p.value))}),o.createElement("span",null,p.label))))}return t==="integer"||t==="float"?o.createElement(A,{className:"mb-3",type:"number",step:t==="integer"?"1":"any",value:e??"",onChange:i=>r(i.target.value),onBlur:i=>a(i.target.value)}):o.createElement(A,{className:"mb-3",type:"text",value:e??"",onChange:i=>r(i.target.value),onBlur:i=>a(i.target.value)})},X=Qe;var Dt=(t,e,n,r)=>t.map((a,l)=>l===e?{...a,[n]:r}:a);var Ze=({text:t})=>o.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{display:"block",fontSize:11,lineHeight:1.4,marginBottom:12},"data-setting-explanation":!0},t),q=Ze;var Re=(t,e,n,r)=>{let a=(t||{})[n],l=(e||{})[n];return l?(a||{})[r[l]]:a},to=({holds:t,labels:e,explanations:n,rows:r,choices:a,outputsOf:l,onChange:d,onSettle:i})=>{let p=Array.isArray(r)?r:[],h=(b,m,g,f)=>{let u=Dt(p,b,m,g);f?i(u):d(u)};return o.createElement("div",{style:{marginBottom:12}},p.map((b,m)=>o.createElement("div",{key:m,className:"rounded-md border border-gray-200 dark:border-zinc-700",style:{padding:"8px 8px 2px",marginBottom:6}},Object.entries(t).map(([g,f])=>o.createElement("label",{key:g,style:{display:"block"}},o.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{display:"block",marginBottom:2,fontSize:11}},(e||{})[g]||g),o.createElement(X,{type:f,value:b[g],choices:Re(a,l,g,b),onChange:u=>h(m,g,u,!1),onSettle:u=>h(m,g,u,!0)}),(n||{})[g]&&o.createElement(q,{text:n[g]}))),o.createElement(v,{variant:"secondary",size:"sm",className:"mb-1.5",onClick:()=>i(p.filter((g,f)=>f!==m))},"Remove"))),o.createElement(v,{variant:"secondary",size:"sm",className:"w-full",onClick:()=>i([...p,{}])},"Add"))},At=to;var eo=({as:t="div",className:e,children:n,...r})=>o.createElement(t,{...r,className:E("ks-panel",e)},n),$=eo;var J=(t,e)=>({className:n,children:r,...a})=>o.createElement(t,{...a,className:E(e,n)},r),W=J("label","ks-label"),In=J("p","ks-hint"),Mn=J("p","ks-error"),jn=J("span","ks-required");var oo={width:280,padding:20,overflowY:"auto"},ro=({node:t,fields:e,holds:n,labels:r,explanations:a,recordLabels:l,recordExplanations:d,recordChoices:i,recordOutputsOf:p,choices:h,onSave:b,onDelete:m,onClose:g,onPickPicture:f,refusal:u})=>{let[k,w]=S(t.config),[C,T]=S(t.picture_url);L(()=>T(t.picture_url),[t.id,t.picture_url]),L(()=>w(t.config),[t.id,t.config]);let x=y=>{w(y),JSON.stringify(y)!==JSON.stringify(t.config)&&b(y)};return o.createElement($,{as:"aside",style:oo,"data-inspector":!0},o.createElement("div",{style:{display:"flex",alignItems:"start",justifyContent:"space-between",gap:8}},o.createElement("h2",{style:{fontWeight:600,marginBottom:2}},t.label),o.createElement("button",{title:"Close",onClick:g,className:"text-gray-500 dark:text-gray-400",style:{border:"none",background:"none",cursor:"pointer",fontSize:18,lineHeight:1}},"\xD7")),o.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginBottom:16}},t.id," \xB7 ",t.type),u&&o.createElement("p",{className:"text-red-800 dark:text-red-400",style:{fontWeight:600,marginBottom:12},"data-refusal":!0},u),Object.entries(e).map(([y,O])=>o.createElement(W,{key:y},o.createElement("span",{style:{display:"block",marginBottom:3}},r[y]||y),O==="list"?o.createElement(At,{holds:n[y]||{},labels:l[y]||{},explanations:(d||{})[y],rows:k[y],choices:{...(i||{})[y],...(t.record_choices||{})[y]},outputsOf:(p||{})[y],onChange:z=>w({...k,[y]:z}),onSettle:z=>x({...k,[y]:z})}):o.createElement(X,{type:O,value:k[y],choices:h[y],pictureUrl:C,onChange:z=>w({...k,[y]:z}),onSettle:z=>x({...k,[y]:z}),onPick:async z=>{let B=await f(z);B&&(T(B.url),x({...k,[y]:B.reference}))}}),(a||{})[y]&&o.createElement(q,{text:a[y]}))),o.createElement(v,{variant:"danger",size:"sm",className:"w-full",onClick:m},"Delete step"))},Ot=ro;var no={width:240,boxSizing:"border-box",padding:"10px 14px",borderRadius:8,textAlign:"center",fontSize:12,cursor:"pointer"},so={minWidth:120,boxSizing:"border-box",padding:"8px 10px",borderRadius:6,textAlign:"center",fontSize:12,cursor:"pointer"},ao="border-2 border-dashed border-amber-500 bg-amber-50 text-amber-700 dark:bg-amber-950 dark:text-amber-300",io="border-2 border-dashed border-accent-600 bg-accent-50 text-accent-800 dark:bg-accent-950 dark:text-accent-200",lo=({node:t,dragging:e,onFill:n,onDrop:r,compact:a=!1})=>o.createElement("div",{ref:t.ref,"data-placeholder":t.id,title:`Choose the step \u201C${t.label}\u201D should lead to`,onClick:n,onDragOver:l=>{e&&(l.preventDefault(),l.dataTransfer.dropEffect="move")},onDrop:l=>{l.preventDefault(),r()},className:e?io:ao,style:a?so:no},o.createElement("div",{style:{fontWeight:600}},t.label),o.createElement("div",{style:{fontSize:11}},e?"drop a step here":"leads nowhere yet \u2014 click to choose")),Pt=lo;var co=({entries:t,at:e,onPick:n,onConnect:r,onDismiss:a,hideStepTypeCodes:l})=>o.createElement($,{className:"shadow-lg",style:{position:"absolute",zIndex:9,top:e.y,left:e.x,width:210,padding:8,borderRadius:8}},o.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{margin:"0 0 6px",fontSize:11}},"Add a step"),t.map(d=>o.createElement(v,{key:d.type,variant:"secondary",size:"sm",className:"w-full mb-1.5 flex-col",onClick:()=>n(d)},d.label,!l&&o.createElement("span",{className:"opacity-75",style:{display:"block",fontSize:11}},d.type))),r&&o.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:r},"Connect to a step already here"),o.createElement(v,{variant:"secondary",size:"sm",className:"w-full",onClick:a},"Cancel")),$t=co;var po=t=>e=>e.label.toLowerCase().includes(t.trim().toLowerCase()),uo=(t,e,n="")=>{let r=Object.values(e).flat(),a=Object.entries(e).map(([l,d])=>({heading:l,entries:d.map(i=>t.find(p=>p.type===i)).filter(Boolean)}));return[{heading:null,entries:t.filter(l=>!r.includes(l.type))},...a].map(l=>({...l,entries:l.entries.filter(po(n))})).filter(l=>l.entries.length>0)},mo={width:200,flex:"none",boxSizing:"border-box",padding:"14px 12px",gap:6,fontSize:12,overflowY:"auto",borderWidth:"0 1px 0 0"},fo={fontSize:11,textTransform:"uppercase",letterSpacing:".04em",padding:"8px 4px 2px"},go={textAlign:"left",padding:"7px 9px",borderRadius:6,fontSize:12,cursor:"grab"},ho=({entries:t,groups:e,onPick:n,onCarry:r,onDrop:a})=>{let[l,d]=S("");return o.createElement($,{as:"aside","aria-label":"Steps","data-step-list":!0,className:"hidden flex-col sm:flex",style:mo},o.createElement(A,{type:"search","aria-label":"Search steps",placeholder:"Search steps",value:l,onChange:i=>d(i.target.value),style:{marginBottom:6,fontSize:12}}),uo(t,e,l).map(i=>o.createElement(o.Fragment,{key:i.heading||""},i.heading&&o.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:fo},i.heading),i.entries.map(p=>o.createElement($,{as:"button",type:"button",key:p.type,"data-step-type":p.type,className:"bg-surface-50 dark:bg-surface-950",style:go,draggable:!0,onClick:()=>n(p),onDragStart:h=>{h.dataTransfer.effectAllowed="copyMove",h.dataTransfer.setData("text/plain",p.type),r(p)},onDragEnd:a},p.label)))))},Lt=ho;var yo={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},It=({label:t,title:e,idle:n,enabled:r,onUse:a})=>o.createElement(v,{variant:"secondary",size:"sm",title:r?e:n,disabled:!r,onClick:a,style:{opacity:r?1:.4,cursor:r?"pointer":"default"}},t),xo=({undoable:t,redoable:e,onAdd:n,onUndo:r,onRedo:a})=>o.createElement("div",{style:{position:"absolute",top:16,left:16,zIndex:5,display:"flex",gap:8}},o.createElement(v,{variant:"secondary",className:"rounded-full",style:yo,title:"Add a step",onClick:n},"+"),o.createElement(It,{label:"\u21B6 Undo",title:"Undo the last change",idle:"Nothing to undo",enabled:t,onUse:r}),o.createElement(It,{label:"\u21B7 Redo",title:"Redo the change you undid",idle:"Nothing to redo",enabled:e,onUse:a})),Mt=xo;var bo=({type:t="info",title:e,message:n,onDismiss:r,className:a})=>o.createElement("div",{className:E("ks-alert",`ks-alert-${t}`,a),role:"alert"},o.createElement("div",{className:"ks-alert-body"},o.createElement("div",{className:"ks-alert-content"},e&&o.createElement("p",{className:"ks-alert-title"},e),o.createElement("p",{className:e?"ks-alert-message-titled":"ks-alert-message"},n)),r&&o.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:r},"\xD7"))),jt=bo;var Ht=t=>{let e=t.map(n=>`\u201C${n.name}\u201D`).join(", ");return t.length===1?`${e} is not connected to the flow and will be removed. Remove it to go on, or cancel and connect it first.`:`${e} are not connected to the flow and will be removed. Remove them to go on, or cancel and connect them first.`};var Wt=({version:t,published:e})=>t?e?e===t?`Version ${t} \xB7 live`:`Version ${t} \xB7 visitors still on ${e}`:`Version ${t} \xB7 never published`:"No version yet";var vo={width:280,padding:20,overflowY:"auto"},st={fontWeight:600,marginBottom:6,marginTop:14},K={fontSize:12,marginBottom:4,lineHeight:1.4},Ft={display:"block",marginBottom:3},Vt=(t,e,n)=>r=>{r.target.value!==(t[e]??"")&&n({[e]:r.target.value})},wo=({flow:t,changes:e,problems:n,refusal:r,notice:a,publishNote:l,warning:d,onCreate:i,onPublish:p,onAccept:h,onDecline:b,onSaveDetails:m,onClose:g})=>o.createElement($,{as:"aside",style:vo,"data-builder-panel":!0},o.createElement("div",{style:{display:"flex",alignItems:"start",justifyContent:"space-between",gap:8}},o.createElement("h2",{style:{fontWeight:600},"data-flow-name":!0},t.title||t.slug),o.createElement("button",{title:"Close",onClick:g,className:"text-gray-500 dark:text-gray-400",style:{border:"none",background:"none",cursor:"pointer",fontSize:18,lineHeight:1}},"\xD7")),o.createElement("a",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:12,display:"block"},href:t.history_url,"data-history":!0},Wt(t)),d?o.createElement("div",{style:{marginTop:14},"data-unconnected-warning":!0},o.createElement(jt,{type:"warning",className:"mb-1.5",message:Ht(d.steps)}),o.createElement(v,{size:"sm",className:"w-full mb-1.5",onClick:h,"data-accept-removal":!0},d.path==="/publish"?"Remove and publish":"Remove and create version"),o.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:b,"data-decline-removal":!0},"Cancel")):o.createElement("div",{style:{marginTop:14}},o.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:i,"data-create-version":!0},"Create version"),o.createElement(v,{size:"sm",className:"w-full mb-1.5",onClick:p,"data-publish":!0},"Publish"),l&&o.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12,lineHeight:1.4},"data-publish-note":!0},l)),o.createElement("h2",{style:st},"Problems"),r&&o.createElement("p",{className:"text-red-800 dark:text-red-400",style:{...K,fontWeight:600},"data-refusal":!0},r),a&&!r&&o.createElement("p",{className:"text-emerald-800 dark:text-emerald-400",style:{...K,fontWeight:600},"data-notice":!0},a),n.length===0&&!r?o.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12}},"Nothing wrong with this flow."):n.map(f=>o.createElement("p",{key:`${f.node}-${f.problem}`,className:"text-amber-700 dark:text-amber-400",style:K,"data-problem":!0},"\u26A0 ",f.sentence)),o.createElement("h2",{style:st},"Changes since the last version"),e.length===0?o.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12}},"Nothing has changed."):e.map((f,u)=>o.createElement("p",{key:u,style:K,"data-change":!0},f)),o.createElement("h2",{style:st},"Details"),o.createElement(W,null,o.createElement("span",{style:Ft},"Title"),o.createElement(A,{className:"mb-3",defaultValue:t.title??"",onBlur:Vt(t,"title",m),"data-flow-title":!0})),o.createElement(W,null,o.createElement("span",{style:Ft},"Start label"),o.createElement(A,{className:"mb-3",defaultValue:t.start_label??"",onBlur:Vt(t,"start_label",m),"data-flow-start-label":!0})),o.createElement("div",{style:{marginTop:16}},o.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",href:t.definition_url,"data-definition":!0},"Definition"),o.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",href:t.details_url,"data-details":!0},"Edit details"))),Yt=wo;var Ut={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},Gt=t=>({opacity:t?1:0,transition:"opacity .12s"}),ko=({link:t,onInsert:e,onRemove:n,onDrop:r,dragging:a,alwaysShowInsertButtons:l})=>{let[d,i]=S(!1),p=d||a;return o.createElement("div",{"data-connector":`${t.source}-${t.target}`,style:{position:"absolute",left:t.midX-34,top:t.midY-20,width:68,height:40,zIndex:4},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onDragEnter:()=>i(!0),onDragLeave:()=>i(!1),onDragOver:h=>{h.preventDefault(),h.dataTransfer.dropEffect="move"},onDrop:h=>{h.preventDefault(),i(!1),r()}},o.createElement("div",{style:{display:"flex",gap:4,justifyContent:"center",alignItems:"center",height:"100%"}},o.createElement(v,{variant:"secondary",title:a?"Move the step here":"Insert a step here",onClick:e,className:"rounded-full data-[over=true]:ring-2 data-[over=true]:ring-accent-600","data-over":!!(a&&d),style:{...Ut,...Gt(p||l)}},"+"),!a&&o.createElement(v,{variant:"danger",title:"Remove this connection",onClick:n,className:"rounded-full",style:{...Ut,...Gt(p)}},"\xD7")))},Xt=ko;var So=({links:t,extent:e,dragging:n,onInsert:r,onRemove:a,onDrop:l,alwaysShowInsertButtons:d})=>o.createElement(o.Fragment,null,o.createElement("svg",{width:e.width,height:e.height,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:1}},o.createElement("defs",null,o.createElement("marker",{id:"easy_flow-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto"},o.createElement("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-gray-400 dark:fill-zinc-500"}))),t.map(i=>o.createElement("path",{key:i.id,"data-link":i.id,className:"stroke-gray-400 dark:stroke-zinc-500",fill:"none",strokeWidth:"1.5",markerEnd:"url(#easy_flow-arrow)",d:i.path}))),t.filter(i=>i.label).map(i=>o.createElement("div",{key:`${i.id}-label`,"data-link-label":i.id,className:"bg-surface-50 text-gray-500 dark:bg-surface-950 dark:text-gray-400",style:{position:"absolute",left:i.midX+(d?2:-10),top:i.midY-18,zIndex:3,fontSize:11,padding:"0 3px"}},i.label)),t.filter(i=>!i.placeholder).map(i=>o.createElement(Xt,{key:i.id,link:i,dragging:!!n,alwaysShowInsertButtons:d,onInsert:()=>r(i),onRemove:()=>a(i),onDrop:()=>l(i)}))),qt=So;var at={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},Jt="opacity-0 transition-opacity group-data-[over=true]:opacity-100",Co=({link:t,onInsert:e,onRemove:n,onDrop:r,alwaysShowInsertButtons:a,dragging:l})=>o.createElement("div",{"data-joint":t?.id,className:"group relative h-7 w-full sm:h-auto sm:w-7 sm:self-stretch",onMouseEnter:d=>{d.currentTarget.dataset.over="true"},onMouseLeave:d=>{delete d.currentTarget.dataset.over},onDragOver:d=>{t&&r&&(d.preventDefault(),d.dataTransfer.dropEffect="move")},onDrop:d=>{t&&(d.preventDefault(),r(t))}},t&&o.createElement("div",{className:"absolute left-1/2 top-0 h-full w-px bg-gray-400 sm:left-0 sm:top-1/2 sm:h-px sm:w-full dark:bg-zinc-500"}),t&&e&&o.createElement("div",{className:"absolute inset-0 flex items-center justify-center gap-1 sm:flex-col",style:{zIndex:4}},o.createElement(v,{variant:"secondary",title:"Insert a step here",onClick:d=>e(t,d),className:`rounded-full ${a?"opacity-100":Jt}`,style:l?{...at,opacity:1}:at},"+"),o.createElement(v,{variant:"danger",title:"Remove this connection",onClick:()=>n(t),className:`rounded-full ${Jt}`,style:at},"\xD7"))),Kt=Co;var No=(t,e)=>t.row-e.row||t.column-e.column,Qt=t=>{let e=[...t].sort(No),n=e.filter(r=>t.some(a=>a.holds?.includes(r.id)));return e.filter(r=>!n.includes(r)).flatMap(r=>[r,...n.filter(a=>r.holds?.includes(a.id))])},Zt=t=>{let e=Qt(t),n=r=>e.some(a=>a.holds?.includes(r.id));return e.filter(r=>!n(r)).reduce((r,a)=>{if(a.holds)return[...r,{group:a,steps:e.filter(d=>a.holds.includes(d.id))}];let l=r[r.length-1];return l&&!l.group?[...r.slice(0,-1),{steps:[...l.steps,a]}]:[...r,{steps:[a]}]},[])},zo=(t,e)=>t[t.findIndex(n=>n.id===e.id)+1]?.id,Rt=(t,e,n)=>{let r=zo(Qt(n),t);return e.filter(a=>a.source===t.id&&(a.label||a.target!==r))},Bo=t=>t?.placeholder?"nowhere yet":t?.label,te=(t,e)=>[t.label,"\u2192",Bo(e.find(n=>n.id===t.target))].filter(Boolean).join(" "),ee=(t,e,n)=>t.find(r=>r.source===e.id&&r.target===n.id);var To={display:"flex",flexDirection:"column",gap:14,padding:"64px 24px 24px"},oe=({steps:t,edges:e,draw:n,joints:r})=>o.createElement("div",{"data-flow-row":!0,className:"flex flex-col sm:flex-row sm:flex-wrap sm:items-center sm:gap-y-3.5"},t.map((a,l)=>o.createElement("div",{key:a.id,className:"flex flex-col sm:flex-row sm:items-center"},l>0&&o.createElement(Kt,{link:ee(e,t[l-1],a),...r}),n(a)))),Eo={display:"flex",flexDirection:"column",gap:8,padding:"10px 12px",borderRadius:8},_o=({group:t,steps:e,edges:n,draw:r,joints:a})=>o.createElement("div",{"data-group-box":t.id,className:"border border-dashed border-gray-400 bg-white/60 dark:border-zinc-600 dark:bg-zinc-900/60",style:Eo},r(t),o.createElement(oe,{steps:e,edges:n,draw:r,joints:a})),Do=({nodes:t,edges:e,draw:n,joints:r,children:a,style:l})=>o.createElement("div",{"data-flow-rows":!0,style:{...To,...l}},a,Zt(t).map(d=>d.group?o.createElement(_o,{key:d.group.id,group:d.group,steps:d.steps,edges:e,draw:n,joints:r}):o.createElement(oe,{key:d.steps[0].id,steps:d.steps,edges:e,draw:n,joints:r}))),Q=Do;var re="Your change was not saved because the server could not be reached.",ne=({base:t,token:e,fetch:n,onFlow:r,onError:a,onNotice:l,onWarning:d=()=>{}})=>async(i,p,h)=>{let b=await n(t+i,{method:p,headers:{"Content-Type":"application/json","X-CSRF-Token":e},body:h&&JSON.stringify(h)}).catch(()=>null);if(!b)return l(null),a(re);let m=await b.json().catch(()=>({}));if(m.unconnected)return l(null),a(null),d({path:i,steps:m.unconnected}),r(await(await n(t+".json",{headers:{Accept:"application/json"}})).json());if(d(null),!b.ok)return l(null),a(m.error||"That change was refused");a(null),l(m.notice||null),r(await(await n(t+".json",{headers:{Accept:"application/json"}})).json())},se=({base:t,token:e,fetch:n,onError:r})=>async a=>{let l=new FormData;l.append("picture",a);let d=await n(t+"/pictures",{method:"POST",headers:{"X-CSRF-Token":e},body:l}).catch(()=>null);if(!d)return r(re),null;let i=await d.json().catch(()=>({}));return d.ok?(r(null),i):(r(i.error||"That picture was refused"),null)};var Ao=(t,e,n)=>{let[r,a]=S(n),[l,d]=S(null),[i,p]=S(null),[h,b]=S(null),m=j(()=>ne({base:t,token:e,fetch:(...f)=>window.fetch(...f),onFlow:a,onError:d,onNotice:p,onWarning:b}),[t,e]),g=j(()=>se({base:t,token:e,fetch:(...f)=>window.fetch(...f),onError:d}),[t,e]);return{flow:r,error:l,notice:i,warning:h,setWarning:b,send:m,pickPicture:g}},ae=Ao;var Z=(t,e,n,r)=>{let a=t.left-n.left+r.scrollLeft,l=t.top-n.top+r.scrollTop;return e==="left"?{x:a,y:l+t.height/2}:e==="right"?{x:a+t.width,y:l+t.height/2}:e==="top"?{x:a+t.width/2,y:l}:{x:a+t.width/2,y:l+t.height}},Oo=(t,e,n)=>n&&e==="top"?{x:t.x,y:n.top}:t,Po=(t,e)=>e==="top"?{x:t.x,y:t.y-3}:e==="left"?{x:t.x-3,y:t.y}:e==="right"?{x:t.x+3,y:t.y}:{x:t.x,y:t.y+3},$o=(t,e,n,r,a)=>{let l={straight:`M ${e.x} ${e.y} L ${n.x} ${n.y}`,turn:`M ${e.x} ${e.y} H ${n.x} V ${n.y}`,lane:`M ${e.x} ${e.y} V ${r} H ${n.x} V ${n.y}`,detour:`M ${e.x} ${e.y} H ${a} V ${n.y} H ${n.x}`}[t.route];return{...t,path:l,midX:t.route==="detour"?a:(e.x+n.x)/2,midY:t.route==="lane"?r:(e.y+n.y)/2}},Lo=(t,e,n,r)=>{let[a,l]=S([]),[d,i]=S({width:"100%",height:"100%"}),[p,h]=S([]);return ht(()=>{let b=()=>{let g=e.current?.getBoundingClientRect();if(!g)return;i({width:e.current.scrollWidth,height:e.current.scrollHeight});let f=t.nodes.filter(u=>u.holds&&!u.loose&&n.current[u.id]).map(u=>{let k=n.current[u.id],w=k.getBoundingClientRect(),C=u.holds.flatMap(x=>n.current[x]?[n.current[x].getBoundingClientRect()]:[]),T=[{left:w.left,top:w.top,width:Math.max(w.width,k.scrollWidth),height:w.height},...C];return{id:u.id,bounds:Ct(T,g,e.current)}});h(f),l(t.edges.flatMap(u=>{let k=n.current[u.source]?.getBoundingClientRect(),w=n.current[u.target]?.getBoundingClientRect();if(!k||!w)return[];let C=Z(k,u.leaves,g,e.current),T=f.find(z=>z.id===u.target)?.bounds,x=Po(Oo(Z(w,u.enters,g,e.current),u.enters,T),u.enters),y=(Z(k,"bottom",g,e.current).y+Z(w,"top",g,e.current).y)/2,O=u.leaves==="left"?Math.min(C.x,x.x)-28:Math.max(C.x,x.x)+28;return[$o(u,C,x,y,O)]}))};b(),window.addEventListener("resize",b);let m=new ResizeObserver(b);return e.current&&m.observe(e.current),()=>{window.removeEventListener("resize",b),m.disconnect()}},r),{links:a,extent:d,boxes:p}},ie=Lo;var le=(t,e)=>{let n=new Set(e),r=t,a=2;for(;n.has(r);)r=`${t}_${a++}`;return r};var Mo=8,jo={display:"flex",height:"100%",minHeight:0,fontSize:13},Ho={flex:1,overflow:"auto",position:"relative"},ce={position:"absolute",top:56,left:16,zIndex:5,width:264,padding:12,borderRadius:8},Wo={...ce,position:"static",alignSelf:"flex-start"},Fo={display:"grid",rowGap:64,columnGap:0,padding:40,justifyContent:"center",position:"relative"},Vo={position:"sticky",zIndex:8,top:8,margin:"8px auto 0",width:"fit-content",padding:"6px 12px",borderRadius:6,fontSize:12},Yo=({port:t,onCancel:e})=>o.createElement("div",{className:"bg-accent-100 text-accent-800 dark:bg-accent-900 dark:text-accent-100",style:Vo},"Choose the step \u201C",t||"next","\u201D should lead to \u2014 ",o.createElement("button",{onClick:e,className:"text-accent-800 underline dark:text-accent-100",style:{border:"none",background:"none",cursor:"pointer",fontSize:12,padding:0}},"cancel")),Uo=({base:t,token:e,initial:n})=>{let{flow:r,error:a,notice:l,warning:d,setWarning:i,send:p,pickPicture:h}=ae(t,e,n),[b,m]=S(null),[g,f]=S(null),[u,k]=S(null),[w,C]=S(null),[T,x]=S(null),[y,O]=S(!1),z=et({}),B=et(null);L(()=>{let s={open:null,publish:"/publish",save_draft:"/versions"},c=N=>{let D=N.target.closest?.("[data-bar-action]");if(!D||!(D.dataset.barAction in s))return;D.closest("details")?.removeAttribute("open"),m(null),O(!0);let F=s[D.dataset.barAction];F&&p(F,"POST")};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[p]),L(()=>{if(!y){i(null);return}let s=c=>{c.target.isConnected&&!c.target.closest("[data-builder-panel], [data-open-panel], [data-bar-action]")&&O(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[y]),L(()=>{document.dispatchEvent(new CustomEvent("easy_flow:flow-named",{detail:r.flow?.title||r.flow?.slug}))},[r.flow?.title,r.flow?.slug]),L(()=>{document.dispatchEvent(new CustomEvent("easy_flow:flow-status",{detail:{status:r.flow?.status,publishes:r.flow?.publishes}}))},[r.flow?.status,r.flow?.publishes]);let he=j(()=>Object.fromEntries(r.nodes.map(s=>[s.id,s])),[r.nodes]),{links:ye,extent:xe,boxes:it}=ie(r,B,z,[r,b,he]),lt=j(()=>{let s={};return r.violations.forEach(c=>{var N;return(s[N=c.node]||(s[N]=[])).push(c)}),s},[r.violations]),_=r.direction==="left_to_right",H=r.nodes.filter(s=>!s.loose),dt=r.nodes.filter(s=>s.loose),be=Math.max(0,...H.map(s=>s.row))+1,ve=Math.max(0,...H.map(s=>s.column))+1,R=s=>{if(!u)return;let[c,N]=u;k(null),c!==s&&p("/edges","POST",{from:c,to:s,on:N||null})},we=s=>{if(s.isDefaultPrevented()||!w)return;s.preventDefault();let c=w;C(null);let N=B.current.getBoundingClientRect(),D=Nt(it,{x:s.clientX-N.left+B.current.scrollLeft,y:s.clientY-N.top+B.current.scrollTop}),F=r.nodes.find(Se=>Se.holds?.includes(c))?.id||null;D!==F&&p(`/steps/${c}/group`,"PATCH",{group:D})},ct=s=>[...r.palette,...r.unoffered||[]].find(c=>c.type===s?.type),M=r.nodes.find(s=>s.id===b),P=ct(M),tt=(s,c={})=>p("/steps","POST",{id:le(s.type,r.nodes.map(N=>N.id)),type:s.type,from:c.from,to:c.to,on:c.on}),pt=s=>{let[c,N]=[T,w];x(null),C(null),c?tt(c,{from:s.source,to:s.target}):N&&p("/steps/"+N+"/move","PATCH",{from:s.source,to:s.target})},ke=s=>{let c=B.current.getBoundingClientRect();return{x:s.clientX-c.left+B.current.scrollLeft+8,y:s.clientY-c.top+B.current.scrollTop+8}},ut=s=>o.createElement(o.Fragment,null,s.placeholder&&o.createElement(Pt,{node:{...s,ref:c=>{z.current[s.id]=c}},dragging:!!w,compact:_,onFill:()=>f({from:s.from,on:s.on,at:{x:16,y:52}}),onDrop:()=>{let c=w;C(null),c&&p("/edges","POST",{from:s.from,to:c,on:s.on})}}),s.holds&&o.createElement(Y,{node:{...s,ref:c=>{z.current[s.id]=c}},header:U(s,ct(s),r.hide_step_type_codes),compact:_,onSelect:()=>u?R(s.id):m(s.id)}),!s.placeholder&&!s.holds&&o.createElement(rt,{node:{...s,ref:c=>{z.current[s.id]=c},violations:lt[s.id]||[],connected:r.edges.filter(c=>c.source===s.id).map(c=>c.label||null)},selected:s.id===b,armed:u&&u[0]===s.id?u[1]:null,connecting:!!u&&u[0]!==s.id,onSelect:()=>u?R(s.id):m(s.id),onOpen:c=>window.location.assign(c),onArm:(c,N)=>{let D=B.current.getBoundingClientRect();f({from:s.id,on:c,at:{x:N.clientX-D.left+B.current.scrollLeft+8,y:N.clientY-D.top+B.current.scrollTop+8}})},onDragEnd:()=>C(null),onDragStart:()=>C(s.id),hideStepTypeCodes:r.hide_step_type_codes,compact:_,branches:_?Rt(s,r.edges,H).map(c=>te(c,r.nodes)):[]})),mt=dt.length>0&&o.createElement("div",{"data-loose":!0,className:"border border-dashed border-gray-300 bg-gray-50 dark:border-zinc-700 dark:bg-zinc-900",style:_?Wo:ce},o.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginBottom:6}},"Not in the flow yet \u2014 drag one onto a connection"),dt.map(s=>o.createElement("div",{key:s.id,style:{marginBottom:8}},o.createElement(rt,{node:{...s,ref:c=>{z.current[s.id]=c},violations:lt[s.id]||[],connected:[]},selected:b===s.id,armed:u&&u[0]===s.id?u[1]:null,connecting:!!u,onSelect:()=>u?R(s.id):m(s.id),onOpen:c=>window.location.assign(c),onArm:(c,N)=>{N.stopPropagation(),k([s.id,c])},onDragStart:()=>C(s.id),onDragEnd:()=>C(null),hideStepTypeCodes:r.hide_step_type_codes}))));return o.createElement("div",{className:"text-gray-900 dark:text-gray-100",style:jo,onMouseUp:()=>C(null),onKeyDown:s=>{s.key==="Escape"&&(m(null),k(null),f(null))},tabIndex:-1},o.createElement(Lt,{entries:r.palette,groups:r.step_groups||{},onPick:s=>tt(s),onCarry:x,onDrop:()=>x(null)}),o.createElement("div",{ref:B,className:"bg-surface-50 dark:bg-surface-950",style:Ho,onClick:s=>{s.target===B.current&&(m(null),k(null),O(!1))},onDragOver:s=>{w&&s.preventDefault()},onDrop:we},u&&o.createElement(Yo,{port:u[1],onCancel:()=>k(null)}),o.createElement(Mt,{undoable:r.undoable,redoable:r.redoable,onAdd:()=>f({at:{x:16,y:52}}),onUndo:()=>{m(null),p("/undo","POST")},onRedo:()=>{m(null),p("/redo","POST")}}),!_&&it.map(s=>o.createElement(St,{key:s.id,id:s.id,bounds:s.bounds,onDrop:()=>{let c=w;C(null),c&&p(`/steps/${c}/group`,"PATCH",{group:s.id})}})),!_&&o.createElement(qt,{links:zt(ye,r.nodes),extent:xe,dragging:w||T,alwaysShowInsertButtons:r.always_show_insert_buttons,onInsert:s=>f({from:s.source,to:s.target,at:{x:s.midX+30,y:s.midY}}),onRemove:s=>{m(null),p("/edges","DELETE",{from:s.source,to:s.target})},onDrop:pt}),!_&&mt,_&&o.createElement(Q,{nodes:H,edges:r.edges,draw:ut,joints:{alwaysShowInsertButtons:r.always_show_insert_buttons,dragging:!!(w||T),onInsert:(s,c)=>f({from:s.source,to:s.target,at:ke(c)}),onRemove:s=>{m(null),p("/edges","DELETE",{from:s.source,to:s.target})},onDrop:pt}},mt),!_&&o.createElement("div",{style:{...Fo,gridTemplateColumns:`repeat(${ve+1}, ${280/2}px)`,gridTemplateRows:`repeat(${be}, auto)`}},H.map(s=>o.createElement("div",{key:s.id,style:{gridRow:s.row+1,gridColumn:`${s.column+1} / span 2`,zIndex:2,marginTop:Bt(s,r.nodes)?Mo-64:0}},ut(s)))),g&&o.createElement($t,{entries:r.palette,at:g.at,onDismiss:()=>f(null),hideStepTypeCodes:r.hide_step_type_codes,onConnect:g.on!==void 0?()=>{k([g.from,g.on]),f(null)}:null,onPick:s=>{let c=g;f(null),tt(s,c)}})),y&&!M&&o.createElement(Yt,{flow:r.flow||{},changes:r.changes||[],problems:r.violations,refusal:a,notice:l,publishNote:r.publish_note,warning:d,onClose:()=>O(!1),onCreate:()=>p("/versions","POST"),onPublish:()=>p("/publish","POST"),onAccept:()=>p(d.path,"POST",{remove_unconnected:d.steps.map(s=>s.id)}),onDecline:()=>i(null),onSaveDetails:s=>p("/details","PATCH",{flow:s})}),M&&o.createElement(Ot,{node:M,fields:P?.fields||{},holds:P?.records||{},labels:P?.labels||{},explanations:P?.explanations||{},recordLabels:P?.record_labels||{},recordExplanations:P?.record_explanations||{},recordChoices:P?.record_choices||{},recordOutputsOf:P?.record_outputs_of||{},choices:Tt(M,P),onClose:()=>m(null),onSave:s=>p(`/steps/${M.id}`,"PATCH",{config:s}),onPickPicture:h,refusal:a,onDelete:()=>{m(null),p(`/steps/${M.id}`,"DELETE")}}))},pe=Uo;var Go={display:"block",minWidth:118,boxSizing:"border-box",borderRadius:6,padding:"8px 10px",textDecoration:"none"},Xo={fontSize:12,fontWeight:500,lineHeight:1.3},ue={done:"border-green-600 bg-green-50 dark:border-green-500 dark:bg-green-950",paused:"border-amber-500 bg-amber-50 dark:border-amber-400 dark:bg-amber-950",pending:"border-gray-300 bg-white text-gray-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-gray-400",failed:"border-red-600 bg-red-50 dark:border-red-500 dark:bg-red-950"},me={done:"text-green-700 dark:text-green-400",paused:"text-amber-800 dark:text-amber-300",pending:"text-gray-500 dark:text-gray-400",failed:"text-red-700 dark:text-red-400"},qo="ring-2 ring-accent-600 ring-offset-2 dark:ring-offset-zinc-950",Jo=({node:t,selected:e=!1})=>{let n=t.address?"a":"div";return o.createElement(n,{"data-step":t.id,href:t.address||void 0,className:`${t.state==="paused"?"border-2":"border"} ${ue[t.state]||ue.pending}${e?` ${qo}`:""}`,style:Go},o.createElement("div",{className:"font-mono text-gray-500 dark:text-gray-400",style:{fontSize:11}},t.type),o.createElement("div",{style:Xo},t.label,t.version&&o.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{fontWeight:400,marginLeft:4}},t.version)),t.status&&o.createElement("div",{className:me[t.state]||me.pending,style:{fontSize:11}},t.status))},fe=Jo;var Ko={gap:12,padding:0},Qo=({nodes:t,edges:e,selected:n})=>o.createElement(Q,{nodes:t,edges:e,joints:{},style:Ko,draw:r=>r.holds?o.createElement(Y,{node:r,header:U(r,r,!1),compact:!0}):o.createElement(fe,{node:r,selected:r.id===n})}),ge=Qo;ot("easy_flow/flow-editor",pe);ot("easy_flow/run-view",ge);document.addEventListener("easy_flow:flow-named",t=>{let e=document.querySelector("[data-flow-heading]");e&&(e.textContent=t.detail)});document.addEventListener("easy_flow:flow-status",({detail:t})=>{t.status&&document.querySelectorAll("[data-version-status]").forEach(e=>{e.textContent=t.status}),t.publishes&&document.querySelectorAll("[data-bar-action=publish]").forEach(e=>{e.textContent=`Publish v${t.publishes}`})});vt(document,ft);})();
|
|
1
|
+
(()=>{var ze=globalThis.ReactDOM;var{createPortal:eo,createRoot:ft,flushSync:ro,hydrateRoot:oo,preconnect:no,prefetchDNS:so,preinit:ao,preinitModule:io,preload:lo,preloadModule:co,requestFormReset:po,unstable_batchedUpdates:uo,useFormState:mo,useFormStatus:fo,version:go}=ze;var gt=globalThis.React,e=gt,{Children:yo,Component:xo,Fragment:bo,PureComponent:vo,StrictMode:wo,Suspense:ko,cloneElement:Co,createContext:So,createElement:No,createRef:zo,forwardRef:Bo,isValidElement:_o,lazy:To,memo:Eo,startTransition:Do,useCallback:Ao,useContext:Oo,useDebugValue:Po,useDeferredValue:$o,useEffect:L,useId:Lo,useImperativeHandle:Io,useLayoutEffect:ht,useMemo:j,useReducer:Mo,useRef:et,useState:C,useSyncExternalStore:jo,useTransition:Ho}=gt;var yt=new Map,V=new Map,rt=(t,r)=>yt.set(t,r),xt=()=>{V.forEach(t=>t.unmount()),V.clear()},bt=(t,r)=>t.querySelectorAll("[data-react-ui]").forEach(n=>{if(V.has(n))return;let o=yt.get(n.dataset.reactUi),a=r(n);V.set(n,a),a.render(e.createElement(o,JSON.parse(n.dataset.props)))});var vt=(t,r)=>{let n=()=>bt(t,r);t.addEventListener("turbo:load",n),t.addEventListener("turbo:frame-load",n),t.addEventListener("turbo:before-cache",xt),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",n):n()};var T=(...t)=>t.filter(Boolean).join(" ");var Be={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},_e={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},Te=({variant:t="primary",size:r="md",className:n,children:o,...a})=>{let i=a.href?"a":"button";return e.createElement(i,{...a,className:T("ks-button",Be[t],_e[r],n)},o)},v=Te;var Ee="border border-amber-500 bg-white text-amber-700 dark:bg-zinc-900 dark:text-amber-400",De="border border-gray-300 bg-white text-gray-500 dark:border-zinc-600 dark:bg-zinc-900 dark:text-gray-400",Ae="border border-accent-600 bg-accent-600 text-white",Oe=({name:t,connected:r,armed:n,onArm:o,connecting:a})=>e.createElement("button",{onClick:i=>{a||(i.stopPropagation(),o(i))},title:n?"Now choose a step to connect to":"Connect this branch",className:n?Ae:r?De:Ee,style:{padding:"1px 8px",marginRight:4,borderRadius:999,fontSize:11,cursor:"pointer"}},t||"next"),wt=Oe;var Pe={width:240,boxSizing:"border-box",borderRadius:8},$e={minWidth:120,boxSizing:"border-box",borderRadius:6},Le={padding:"8px 14px",textAlign:"center",fontWeight:600},Ie={fontWeight:600,lineHeight:1.3},Me={fontSize:12,fontWeight:500,lineHeight:1.3},je=(t,r,n)=>{let o=n?"ring-4 ring-accent-600/15":"shadow-sm";return t||n&&!r?`border-accent-600 ${o}`:r?`border-red-600 ${o}`:"border-gray-300 shadow-sm dark:border-zinc-700"},He=(t,r)=>r&&t.label===t.id&&t.type_name||t.label,We=(t,r,n)=>n?r===t.type_name?null:t.type_name:t.type,Fe=({node:t,selected:r,armed:n,connecting:o,onSelect:a,onOpen:i,onArm:c,onDragEnd:d,onDragStart:l,hideStepTypeCodes:y,branches:h=[],compact:m=!1,typeAbove:g=m})=>{let f=t.begins_here||t.ends_here,u=t.begins_here,k=t.ends_here?[]:t.ports,w=o&&!u,S=He(t,y),_=We(t,S,y);return e.createElement("div",{ref:t.ref,"data-step":t.id,draggable:!u,onDragStart:b=>{b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",t.id),l()},onDragEnd:d,onClick:t.opens&&!o?()=>i(t.opens):a,className:`bg-white ${m&&!r?"border":"border-2"} dark:bg-zinc-900 ${je(w,t.violations.length>0,r)}`,style:{...m?$e:Pe,padding:f?0:m?"8px 10px":"12px 14px",cursor:u?"default":o?"crosshair":"grab"}},!f&&g&&_&&e.createElement("div",{className:"font-mono text-gray-500 dark:text-gray-400",style:{fontSize:11}},_),f&&e.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:Le},S),!f&&e.createElement("div",{style:m?Me:Ie},S),t.violations.length>0&&e.createElement("div",{"data-error-count":!0,className:"text-red-600 dark:text-red-400",style:{fontSize:10}},`${t.violations.length} error${t.violations.length===1?"":"s"}`),!f&&t.summary&&t.violations.length===0&&e.createElement("div",{className:r?"text-accent-600 dark:text-accent-400":"text-gray-500 dark:text-gray-400",style:{fontSize:10}},t.summary),!f&&!g&&_&&e.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginTop:2}},_),t.picture_url&&e.createElement("div",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:11,marginTop:2}},"Has a picture"),t.starts_a_flow&&e.createElement("div",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:11,marginTop:2}},"Runs a flow"),t.opens&&e.createElement(v,{variant:"secondary",size:"sm",className:"mt-2",onClick:b=>{b.stopPropagation(),a()}},"Settings"),h.map(b=>e.createElement("div",{key:b,className:"text-gray-500 dark:text-gray-400",style:{fontSize:10}},b)),k.length>0&&e.createElement("div",{style:{padding:t.begins_here?"0 14px 8px":"10px 0 0"}},k.map(b=>e.createElement(wt,{key:b,name:b,connected:t.connected.includes(b),connecting:o,armed:n===b,onArm:x=>c(b,x)}))))},ot=Fe;var kt={position:"relative",zIndex:2,width:240,fontSize:11,whiteSpace:"nowrap",cursor:"pointer"},Ve={...kt,width:"auto",whiteSpace:"normal",overflowWrap:"anywhere"},Ye=({node:t,header:r,onSelect:n,compact:o=!1})=>e.createElement("div",{ref:t.ref,"data-group-header":t.id,onClick:n,className:"font-mono text-gray-500 dark:text-gray-400",style:{...o?Ve:kt,...n?{}:{cursor:"default"}}},r),Y=Ye;var Ue=({id:t,bounds:r,onDrop:n})=>e.createElement("div",{"data-group-box":t,onDragOver:o=>{o.preventDefault(),o.dataTransfer.dropEffect="move"},onDrop:o=>{o.preventDefault(),n()},className:"border border-dashed border-gray-400 bg-white/60 dark:border-zinc-600 dark:bg-zinc-900/60",style:{position:"absolute",zIndex:1,borderRadius:8,boxSizing:"border-box",...r}}),Ct=Ue;var Ge=t=>t!=null&&t!==""&&typeof t!="object",Xe=["integer","float"],qe=(t,r,n)=>n&&r.labels?.[t]||t,U=(t,r,n)=>{let o=Object.keys(r?.fields||{}).filter(a=>Ge(t.config[a])).map(a=>`${qe(a,r,n)}${Xe.includes(r.fields[a])?"":":"} ${t.config[a]}`);return[n&&t.type_name||t.type,...o].join(" \xB7 ")};var St=(t,r,n)=>{let o=Math.min(...t.map(d=>d.left))-r.left+n.scrollLeft-12,a=Math.min(...t.map(d=>d.top))-r.top+n.scrollTop-10,i=Math.max(...t.map(d=>d.left+d.width))-r.left+n.scrollLeft+12,c=Math.max(...t.map(d=>d.top+d.height))-r.top+n.scrollTop+10;return{left:o,top:a,width:i-o,height:c-a}},Je=({left:t,top:r,width:n,height:o},a)=>a.x>=t&&a.x<=t+n&&a.y>=r&&a.y<=r+o,Nt=(t,r)=>t.find(n=>Je(n.bounds,r))?.id||null,zt=(t,r)=>t.filter(n=>!r.some(o=>o.id===n.source&&o.holds?.includes(n.target))),Bt=(t,r)=>r.some(n=>n.holds?.includes(t.id)&&!n.loose&&n.row===t.row-1);var nt=(t,r)=>t.includes(r)?t.filter(n=>n!==r):[...t,r],_t=(t,r)=>({...r?.choices||{},...t?.choices||{}});var Ke=({as:t="input",disabled:r,className:n,...o})=>e.createElement(t,{...o,disabled:r,className:T("ks-input",r&&"ks-input-disabled",n)}),A=Ke;var Qe=t=>e.createElement(A,{...t,as:"select"}),Tt=Qe;var Ze=({className:t,...r})=>e.createElement("input",{type:"checkbox",...r,className:T("ks-checkbox",t)}),G=Ze;var Re=({name:t,value:r,label:n,hint:o,...a})=>e.createElement("label",{className:"inline-block cursor-pointer relative"},e.createElement("input",{type:"radio",name:t,value:r,...a,className:"peer sr-only"}),e.createElement("span",{className:"ks-radio-card inline-flex flex-col cursor-pointer transition ks-radio-card-highlight"},e.createElement("span",{className:"ks-radio-card-header flex items-start justify-between"},e.createElement("span",{className:"ks-radio-card-label block"},n)),o!=null&&e.createElement("span",{className:"ks-radio-card-hint block text-sm"},o))),Et=Re;var tr=({name:t,options:r,value:n,onChange:o})=>e.createElement("div",{className:"flex flex-wrap ks-grid-gap-sm"},r.map(a=>e.createElement(Et,{key:a.value,name:t,...a,checked:a.value===n,onChange:o}))),Dt=tr;var At=t=>(t||[]).map(r=>typeof r=="object"?r:{value:r,label:r}),er=({name:t,type:r,value:n,choices:o,onChange:a,onSettle:i,onPick:c,pictureUrl:d})=>{if(r==="picture")return e.createElement("div",{className:"mb-3"},n&&d&&e.createElement("img",{src:d,alt:"The step's picture",style:{maxWidth:"100%"}}),n&&e.createElement("button",{type:"button","data-remove-picture":!0,className:"ks-button ks-button-secondary ks-button-sm",onClick:()=>i("")},"Remove picture"),e.createElement("input",{type:"file",accept:"image/*",onChange:l=>l.target.files[0]&&c(l.target.files[0])}));if(r==="boolean")return e.createElement(G,{checked:!!n,onChange:l=>i(l.target.checked)});if(r==="select"||r==="previous_step"||r==="from_step"||r==="flow")return e.createElement(Tt,{className:"mb-3",value:n??"",onChange:l=>i(l.target.value)},e.createElement("option",{value:""}),At(o).map(l=>e.createElement("option",{key:l.value,value:l.value},l.label)));if(r==="radio_cards")return e.createElement("div",{"data-radio-cards":!0,className:"mb-3 [&_label]:flex-[1_1_7rem] [&_.ks-radio-card]:flex [&_.ks-radio-card]:h-full"},e.createElement(Dt,{name:t,value:n,options:o||[],onChange:l=>i(l.target.value)}));if(r==="multi_select"){let l=Array.isArray(n)?n:[],y=h=>i(nt(l,h));return e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:8}},(o||[]).map(h=>e.createElement("label",{key:h,style:{display:"inline-flex",alignItems:"center",gap:4}},e.createElement(G,{checked:l.includes(h),onChange:()=>y(h)}),e.createElement("span",null,h))))}if(r==="flows"){let l=Array.isArray(n)?n:[];return e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4},className:"mb-3"},At(o).map(y=>e.createElement("label",{key:y.value,style:{display:"inline-flex",alignItems:"center",gap:4}},e.createElement(G,{checked:l.includes(y.value),onChange:()=>i(nt(l,y.value))}),e.createElement("span",null,y.label))))}return r==="integer"||r==="float"?e.createElement(A,{className:"mb-3",type:"number",step:r==="integer"?"1":"any",value:n??"",onChange:l=>a(l.target.value),onBlur:l=>i(l.target.value)}):e.createElement(A,{className:"mb-3",type:"text",value:n??"",onChange:l=>a(l.target.value),onBlur:l=>i(l.target.value)})},X=er;var Ot=(t,r,n,o)=>t.map((a,i)=>i===r?{...a,[n]:o}:a);var rr=({text:t})=>e.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{display:"block",fontSize:11,lineHeight:1.4,marginBottom:12},"data-setting-explanation":!0},t),q=rr;var or=(t,r,n,o)=>{let a=(t||{})[n],i=(r||{})[n];return i?(a||{})[o[i]]:a},nr=({holds:t,labels:r,explanations:n,rows:o,choices:a,outputsOf:i,onChange:c,onSettle:d})=>{let l=Array.isArray(o)?o:[],y=(h,m,g,f)=>{let u=Ot(l,h,m,g);f?d(u):c(u)};return e.createElement("div",{style:{marginBottom:12}},l.map((h,m)=>e.createElement("div",{key:m,className:"rounded-md border border-gray-200 dark:border-zinc-700",style:{padding:"8px 8px 2px",marginBottom:6}},Object.entries(t).map(([g,f])=>e.createElement("label",{key:g,style:{display:"block"}},e.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{display:"block",marginBottom:2,fontSize:11}},(r||{})[g]||g),e.createElement(X,{type:f,value:h[g],choices:or(a,i,g,h),onChange:u=>y(m,g,u,!1),onSettle:u=>y(m,g,u,!0)}),(n||{})[g]&&e.createElement(q,{text:n[g]}))),e.createElement(v,{variant:"secondary",size:"sm",className:"mb-1.5",onClick:()=>d(l.filter((g,f)=>f!==m))},"Remove"))),e.createElement(v,{variant:"secondary",size:"sm",className:"w-full",onClick:()=>d([...l,{}])},"Add"))},Pt=nr;var sr=({as:t="div",className:r,children:n,...o})=>e.createElement(t,{...o,className:T("ks-panel",r)},n),$=sr;var J=(t,r)=>({className:n,children:o,...a})=>e.createElement(t,{...a,className:T(r,n)},o),W=J("label","ks-label"),Xn=J("p","ks-hint"),qn=J("p","ks-error"),Jn=J("span","ks-required");var ar={width:280,padding:20,overflowY:"auto"},ir=({node:t,fields:r,holds:n,labels:o,explanations:a,recordLabels:i,recordExplanations:c,recordChoices:d,recordOutputsOf:l,choices:y,onSave:h,onDelete:m,onClose:g,onPickPicture:f,refusal:u})=>{let[k,w]=C(t.config),[S,_]=C(t.picture_url);L(()=>_(t.picture_url),[t.id,t.picture_url]),L(()=>w(t.config),[t.id,t.config]);let b=x=>{w(x),JSON.stringify(x)!==JSON.stringify(t.config)&&h(x)};return e.createElement($,{as:"aside",style:ar,"data-inspector":!0},e.createElement("div",{style:{display:"flex",alignItems:"start",justifyContent:"space-between",gap:8}},e.createElement("h2",{style:{fontWeight:600,marginBottom:2}},t.label),e.createElement("button",{title:"Close",onClick:g,className:"text-gray-500 dark:text-gray-400",style:{border:"none",background:"none",cursor:"pointer",fontSize:18,lineHeight:1}},"\xD7")),e.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginBottom:16}},t.id," \xB7 ",t.type),u&&e.createElement("p",{className:"text-red-800 dark:text-red-400",style:{fontWeight:600,marginBottom:12},"data-refusal":!0},u),Object.entries(r).map(([x,O])=>e.createElement(W,{key:x},e.createElement("span",{style:{display:"block",marginBottom:3}},o[x]||x),O==="list"?e.createElement(Pt,{holds:n[x]||{},labels:i[x]||{},explanations:(c||{})[x],rows:k[x],choices:{...(d||{})[x],...(t.record_choices||{})[x]},outputsOf:(l||{})[x],onChange:z=>w({...k,[x]:z}),onSettle:z=>b({...k,[x]:z})}):e.createElement(X,{name:x,type:O,value:k[x],choices:y[x],pictureUrl:S,onChange:z=>w({...k,[x]:z}),onSettle:z=>b({...k,[x]:z}),onPick:async z=>{let B=await f(z);B&&(_(B.url),b({...k,[x]:B.reference}))}}),(a||{})[x]&&e.createElement(q,{text:a[x]}))),e.createElement(v,{variant:"danger",size:"sm",className:"w-full",onClick:m},"Delete step"))},$t=ir;var lr={width:240,boxSizing:"border-box",padding:"10px 14px",borderRadius:8,textAlign:"center",fontSize:12,cursor:"pointer"},dr={minWidth:120,boxSizing:"border-box",padding:"8px 10px",borderRadius:6,textAlign:"center",fontSize:12,cursor:"pointer"},cr="border-2 border-dashed border-amber-500 bg-amber-50 text-amber-700 dark:bg-amber-950 dark:text-amber-300",pr="border-2 border-dashed border-accent-600 bg-accent-50 text-accent-800 dark:bg-accent-950 dark:text-accent-200",ur=({node:t,dragging:r,onFill:n,onDrop:o,compact:a=!1})=>e.createElement("div",{ref:t.ref,"data-placeholder":t.id,title:`Choose the step \u201C${t.label}\u201D should lead to`,onClick:n,onDragOver:i=>{r&&(i.preventDefault(),i.dataTransfer.dropEffect="move")},onDrop:i=>{i.preventDefault(),o()},className:r?pr:cr,style:a?dr:lr},e.createElement("div",{style:{fontWeight:600}},t.label),e.createElement("div",{style:{fontSize:11}},r?"drop a step here":"leads nowhere yet \u2014 click to choose")),Lt=ur;var mr=({entries:t,at:r,onPick:n,onConnect:o,onDismiss:a,hideStepTypeCodes:i})=>e.createElement($,{className:"shadow-lg",style:{position:"absolute",zIndex:9,top:r.y,left:r.x,width:210,padding:8,borderRadius:8}},e.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{margin:"0 0 6px",fontSize:11}},"Add a step"),t.map(c=>e.createElement(v,{key:c.type,variant:"secondary",size:"sm",className:"w-full mb-1.5 flex-col",onClick:()=>n(c)},c.label,!i&&e.createElement("span",{className:"opacity-75",style:{display:"block",fontSize:11}},c.type))),o&&e.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:o},"Connect to a step already here"),e.createElement(v,{variant:"secondary",size:"sm",className:"w-full",onClick:a},"Cancel")),It=mr;var fr=t=>r=>r.label.toLowerCase().includes(t.trim().toLowerCase()),gr=(t,r,n="")=>{let o=Object.values(r).flat(),a=Object.entries(r).map(([i,c])=>({heading:i,entries:c.map(d=>t.find(l=>l.type===d)).filter(Boolean)}));return[{heading:null,entries:t.filter(i=>!o.includes(i.type))},...a].map(i=>({...i,entries:i.entries.filter(fr(n))})).filter(i=>i.entries.length>0)},hr={width:200,flex:"none",boxSizing:"border-box",padding:"14px 12px",gap:6,fontSize:12,overflowY:"auto",borderWidth:"0 1px 0 0"},yr={fontSize:11,textTransform:"uppercase",letterSpacing:".04em",padding:"8px 4px 2px"},xr={textAlign:"left",padding:"7px 9px",borderRadius:6,fontSize:12,cursor:"grab"},br=({entries:t,groups:r,onPick:n,onCarry:o,onDrop:a})=>{let[i,c]=C("");return e.createElement($,{as:"aside","aria-label":"Steps","data-step-list":!0,className:"hidden flex-col sm:flex",style:hr},e.createElement(A,{type:"search","aria-label":"Search steps",placeholder:"Search steps",value:i,onChange:d=>c(d.target.value),style:{marginBottom:6,fontSize:12}}),gr(t,r,i).map(d=>e.createElement(e.Fragment,{key:d.heading||""},d.heading&&e.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:yr},d.heading),d.entries.map(l=>e.createElement($,{as:"button",type:"button",key:l.type,"data-step-type":l.type,className:"bg-surface-50 dark:bg-surface-950",style:xr,draggable:!0,onClick:()=>n(l),onDragStart:y=>{y.dataTransfer.effectAllowed="copyMove",y.dataTransfer.setData("text/plain",l.type),o(l)},onDragEnd:a},l.label)))))},Mt=br;var vr={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},jt=({label:t,title:r,idle:n,enabled:o,onUse:a})=>e.createElement(v,{variant:"secondary",size:"sm",title:o?r:n,disabled:!o,onClick:a,style:{opacity:o?1:.4,cursor:o?"pointer":"default"}},t),wr=({undoable:t,redoable:r,onAdd:n,onUndo:o,onRedo:a})=>e.createElement("div",{style:{position:"absolute",top:16,left:16,zIndex:5,display:"flex",gap:8}},e.createElement(v,{variant:"secondary",className:"rounded-full",style:vr,title:"Add a step",onClick:n},"+"),e.createElement(jt,{label:"\u21B6 Undo",title:"Undo the last change",idle:"Nothing to undo",enabled:t,onUse:o}),e.createElement(jt,{label:"\u21B7 Redo",title:"Redo the change you undid",idle:"Nothing to redo",enabled:r,onUse:a})),Ht=wr;var kr=({type:t="info",title:r,message:n,onDismiss:o,className:a})=>e.createElement("div",{className:T("ks-alert",`ks-alert-${t}`,a),role:"alert"},e.createElement("div",{className:"ks-alert-body"},e.createElement("div",{className:"ks-alert-content"},r&&e.createElement("p",{className:"ks-alert-title"},r),e.createElement("p",{className:r?"ks-alert-message-titled":"ks-alert-message"},n)),o&&e.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:o},"\xD7"))),Wt=kr;var Ft=t=>{let r=t.map(n=>`\u201C${n.name}\u201D`).join(", ");return t.length===1?`${r} is not connected to the flow and will be removed. Remove it to go on, or cancel and connect it first.`:`${r} are not connected to the flow and will be removed. Remove them to go on, or cancel and connect them first.`};var Vt=({version:t,published:r})=>t?r?r===t?`Version ${t} \xB7 live`:`Version ${t} \xB7 visitors still on ${r}`:`Version ${t} \xB7 never published`:"No version yet";var Cr={width:280,padding:20,overflowY:"auto"},st={fontWeight:600,marginBottom:6,marginTop:14},K={fontSize:12,marginBottom:4,lineHeight:1.4},Yt={display:"block",marginBottom:3},Ut=(t,r,n)=>o=>{o.target.value!==(t[r]??"")&&n({[r]:o.target.value})},Sr=({flow:t,changes:r,problems:n,refusal:o,notice:a,publishNote:i,warning:c,onCreate:d,onPublish:l,onAccept:y,onDecline:h,onSaveDetails:m,onClose:g})=>e.createElement($,{as:"aside",style:Cr,"data-builder-panel":!0},e.createElement("div",{style:{display:"flex",alignItems:"start",justifyContent:"space-between",gap:8}},e.createElement("h2",{style:{fontWeight:600},"data-flow-name":!0},t.title||t.slug),e.createElement("button",{title:"Close",onClick:g,className:"text-gray-500 dark:text-gray-400",style:{border:"none",background:"none",cursor:"pointer",fontSize:18,lineHeight:1}},"\xD7")),e.createElement("a",{className:"text-accent-600 dark:text-accent-400",style:{fontSize:12,display:"block"},href:t.history_url,"data-history":!0},Vt(t)),c?e.createElement("div",{style:{marginTop:14},"data-unconnected-warning":!0},e.createElement(Wt,{type:"warning",className:"mb-1.5",message:Ft(c.steps)}),e.createElement(v,{size:"sm",className:"w-full mb-1.5",onClick:y,"data-accept-removal":!0},c.path==="/publish"?"Remove and publish":"Remove and create version"),e.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:h,"data-decline-removal":!0},"Cancel")):e.createElement("div",{style:{marginTop:14}},e.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",onClick:d,"data-create-version":!0},"Create version"),e.createElement(v,{size:"sm",className:"w-full mb-1.5",onClick:l,"data-publish":!0},"Publish"),i&&e.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12,lineHeight:1.4},"data-publish-note":!0},i)),e.createElement("h2",{style:st},"Problems"),o&&e.createElement("p",{className:"text-red-800 dark:text-red-400",style:{...K,fontWeight:600},"data-refusal":!0},o),a&&!o&&e.createElement("p",{className:"text-emerald-800 dark:text-emerald-400",style:{...K,fontWeight:600},"data-notice":!0},a),n.length===0&&!o?e.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12}},"Nothing wrong with this flow."):n.map(f=>e.createElement("p",{key:`${f.node}-${f.problem}`,className:"text-amber-700 dark:text-amber-400",style:K,"data-problem":!0},"\u26A0 ",f.sentence)),e.createElement("h2",{style:st},"Changes since the last version"),r.length===0?e.createElement("p",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:12}},"Nothing has changed."):r.map((f,u)=>e.createElement("p",{key:u,style:K,"data-change":!0},f)),e.createElement("h2",{style:st},"Details"),e.createElement(W,null,e.createElement("span",{style:Yt},"Title"),e.createElement(A,{className:"mb-3",defaultValue:t.title??"",onBlur:Ut(t,"title",m),"data-flow-title":!0})),e.createElement(W,null,e.createElement("span",{style:Yt},"Start label"),e.createElement(A,{className:"mb-3",defaultValue:t.start_label??"",onBlur:Ut(t,"start_label",m),"data-flow-start-label":!0})),e.createElement("div",{style:{marginTop:16}},e.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",href:t.definition_url,"data-definition":!0},"Definition"),e.createElement(v,{variant:"secondary",size:"sm",className:"w-full mb-1.5",href:t.details_url,"data-details":!0},"Edit details"))),Gt=Sr;var Xt={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},qt=t=>({opacity:t?1:0,transition:"opacity .12s"}),Nr=({link:t,onInsert:r,onRemove:n,onDrop:o,dragging:a,alwaysShowInsertButtons:i})=>{let[c,d]=C(!1),l=c||a;return e.createElement("div",{"data-connector":`${t.source}-${t.target}`,style:{position:"absolute",left:t.midX-34,top:t.midY-20,width:68,height:40,zIndex:4},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onDragEnter:()=>d(!0),onDragLeave:()=>d(!1),onDragOver:y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},onDrop:y=>{y.preventDefault(),d(!1),o()}},e.createElement("div",{style:{display:"flex",gap:4,justifyContent:"center",alignItems:"center",height:"100%"}},e.createElement(v,{variant:"secondary",title:a?"Move the step here":"Insert a step here",onClick:r,className:"rounded-full data-[over=true]:ring-2 data-[over=true]:ring-accent-600","data-over":!!(a&&c),style:{...Xt,...qt(l||i)}},"+"),!a&&e.createElement(v,{variant:"danger",title:"Remove this connection",onClick:n,className:"rounded-full",style:{...Xt,...qt(l)}},"\xD7")))},Jt=Nr;var zr=({links:t,extent:r,dragging:n,onInsert:o,onRemove:a,onDrop:i,alwaysShowInsertButtons:c})=>e.createElement(e.Fragment,null,e.createElement("svg",{width:r.width,height:r.height,style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:1}},e.createElement("defs",null,e.createElement("marker",{id:"easy_flow-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto"},e.createElement("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-gray-400 dark:fill-zinc-500"}))),t.map(d=>e.createElement("path",{key:d.id,"data-link":d.id,className:"stroke-gray-400 dark:stroke-zinc-500",fill:"none",strokeWidth:"1.5",markerEnd:"url(#easy_flow-arrow)",d:d.path}))),t.filter(d=>d.label).map(d=>e.createElement("div",{key:`${d.id}-label`,"data-link-label":d.id,className:"bg-surface-50 text-gray-500 dark:bg-surface-950 dark:text-gray-400",style:{position:"absolute",left:d.midX+(c?2:-10),top:d.midY-18,zIndex:3,fontSize:11,padding:"0 3px"}},d.label)),t.filter(d=>!d.placeholder).map(d=>e.createElement(Jt,{key:d.id,link:d,dragging:!!n,alwaysShowInsertButtons:c,onInsert:()=>o(d),onRemove:()=>a(d),onDrop:()=>i(d)}))),Kt=zr;var at={width:24,height:24,padding:0,fontSize:15,lineHeight:"15px"},Qt="opacity-0 transition-opacity group-data-[over=true]:opacity-100",Br=({link:t,onInsert:r,onRemove:n,onDrop:o,alwaysShowInsertButtons:a,dragging:i})=>e.createElement("div",{"data-joint":t?.id,className:"group relative h-7 w-full sm:h-auto sm:w-7 sm:self-stretch",onMouseEnter:c=>{c.currentTarget.dataset.over="true"},onMouseLeave:c=>{delete c.currentTarget.dataset.over},onDragOver:c=>{t&&o&&(c.preventDefault(),c.dataTransfer.dropEffect="move")},onDrop:c=>{t&&(c.preventDefault(),o(t))}},t&&e.createElement("div",{className:"absolute left-1/2 top-0 h-full w-px bg-gray-400 sm:left-0 sm:top-1/2 sm:h-px sm:w-full dark:bg-zinc-500"}),t&&r&&e.createElement("div",{className:"absolute inset-0 flex items-center justify-center gap-1 sm:flex-col",style:{zIndex:4}},e.createElement(v,{variant:"secondary",title:"Insert a step here",onClick:c=>r(t,c),className:`rounded-full ${a?"opacity-100":Qt}`,style:i?{...at,opacity:1}:at},"+"),e.createElement(v,{variant:"danger",title:"Remove this connection",onClick:()=>n(t),className:`rounded-full ${Qt}`,style:at},"\xD7"))),Zt=Br;var _r=(t,r)=>t.row-r.row||t.column-r.column,Rt=t=>{let r=[...t].sort(_r),n=r.filter(o=>t.some(a=>a.holds?.includes(o.id)));return r.filter(o=>!n.includes(o)).flatMap(o=>[o,...n.filter(a=>o.holds?.includes(a.id))])},te=t=>{let r=Rt(t),n=o=>r.some(a=>a.holds?.includes(o.id));return r.filter(o=>!n(o)).reduce((o,a)=>{if(a.holds)return[...o,{group:a,steps:r.filter(c=>a.holds.includes(c.id))}];let i=o[o.length-1];return i&&!i.group?[...o.slice(0,-1),{steps:[...i.steps,a]}]:[...o,{steps:[a]}]},[])},Tr=(t,r)=>t[t.findIndex(n=>n.id===r.id)+1]?.id,ee=(t,r,n)=>{let o=Tr(Rt(n),t);return r.filter(a=>a.source===t.id&&(a.label||a.target!==o))},Er=t=>t?.placeholder?"nowhere yet":t?.label,re=(t,r)=>[t.label,"\u2192",Er(r.find(n=>n.id===t.target))].filter(Boolean).join(" "),oe=(t,r,n)=>t.find(o=>o.source===r.id&&o.target===n.id);var Dr={display:"flex",flexDirection:"column",gap:14,padding:"64px 24px 24px"},ne=({steps:t,edges:r,draw:n,joints:o})=>e.createElement("div",{"data-flow-row":!0,className:"flex flex-col sm:flex-row sm:flex-wrap sm:items-center sm:gap-y-3.5"},t.map((a,i)=>e.createElement("div",{key:a.id,className:"flex flex-col sm:flex-row sm:items-center"},i>0&&e.createElement(Zt,{link:oe(r,t[i-1],a),...o}),n(a)))),Ar={display:"flex",flexDirection:"column",gap:8,padding:"10px 12px",borderRadius:8},Or=({group:t,steps:r,edges:n,draw:o,joints:a})=>e.createElement("div",{"data-group-box":t.id,className:"border border-dashed border-gray-400 bg-white/60 dark:border-zinc-600 dark:bg-zinc-900/60",style:Ar},o(t),e.createElement(ne,{steps:r,edges:n,draw:o,joints:a})),Pr=({nodes:t,edges:r,draw:n,joints:o,children:a,style:i})=>e.createElement("div",{"data-flow-rows":!0,style:{...Dr,...i}},a,te(t).map(c=>c.group?e.createElement(Or,{key:c.group.id,group:c.group,steps:c.steps,edges:r,draw:n,joints:o}):e.createElement(ne,{key:c.steps[0].id,steps:c.steps,edges:r,draw:n,joints:o}))),Q=Pr;var se="Your change was not saved because the server could not be reached.",ae=({base:t,token:r,fetch:n,onFlow:o,onError:a,onNotice:i,onWarning:c=()=>{}})=>async(d,l,y)=>{let h=await n(t+d,{method:l,headers:{"Content-Type":"application/json","X-CSRF-Token":r},body:y&&JSON.stringify(y)}).catch(()=>null);if(!h)return i(null),a(se);let m=await h.json().catch(()=>({}));if(m.unconnected)return i(null),a(null),c({path:d,steps:m.unconnected}),o(await(await n(t+".json",{headers:{Accept:"application/json"}})).json());if(c(null),!h.ok)return i(null),a(m.error||"That change was refused");a(null),i(m.notice||null),o(await(await n(t+".json",{headers:{Accept:"application/json"}})).json())},ie=({base:t,token:r,fetch:n,onError:o})=>async a=>{let i=new FormData;i.append("picture",a);let c=await n(t+"/pictures",{method:"POST",headers:{"X-CSRF-Token":r},body:i}).catch(()=>null);if(!c)return o(se),null;let d=await c.json().catch(()=>({}));return c.ok?(o(null),d):(o(d.error||"That picture was refused"),null)};var $r=(t,r,n)=>{let[o,a]=C(n),[i,c]=C(null),[d,l]=C(null),[y,h]=C(null),m=j(()=>ae({base:t,token:r,fetch:(...f)=>window.fetch(...f),onFlow:a,onError:c,onNotice:l,onWarning:h}),[t,r]),g=j(()=>ie({base:t,token:r,fetch:(...f)=>window.fetch(...f),onError:c}),[t,r]);return{flow:o,error:i,notice:d,warning:y,setWarning:h,send:m,pickPicture:g}},le=$r;var Z=(t,r,n,o)=>{let a=t.left-n.left+o.scrollLeft,i=t.top-n.top+o.scrollTop;return r==="left"?{x:a,y:i+t.height/2}:r==="right"?{x:a+t.width,y:i+t.height/2}:r==="top"?{x:a+t.width/2,y:i}:{x:a+t.width/2,y:i+t.height}},Lr=(t,r,n)=>n&&r==="top"?{x:t.x,y:n.top}:t,Ir=(t,r)=>r==="top"?{x:t.x,y:t.y-3}:r==="left"?{x:t.x-3,y:t.y}:r==="right"?{x:t.x+3,y:t.y}:{x:t.x,y:t.y+3},Mr=(t,r,n,o,a)=>{let i={straight:`M ${r.x} ${r.y} L ${n.x} ${n.y}`,turn:`M ${r.x} ${r.y} H ${n.x} V ${n.y}`,lane:`M ${r.x} ${r.y} V ${o} H ${n.x} V ${n.y}`,detour:`M ${r.x} ${r.y} H ${a} V ${n.y} H ${n.x}`}[t.route];return{...t,path:i,midX:t.route==="detour"?a:(r.x+n.x)/2,midY:t.route==="lane"?o:(r.y+n.y)/2}},jr=(t,r,n,o)=>{let[a,i]=C([]),[c,d]=C({width:"100%",height:"100%"}),[l,y]=C([]);return ht(()=>{let h=()=>{let g=r.current?.getBoundingClientRect();if(!g)return;d({width:r.current.scrollWidth,height:r.current.scrollHeight});let f=t.nodes.filter(u=>u.holds&&!u.loose&&n.current[u.id]).map(u=>{let k=n.current[u.id],w=k.getBoundingClientRect(),S=u.holds.flatMap(b=>n.current[b]?[n.current[b].getBoundingClientRect()]:[]),_=[{left:w.left,top:w.top,width:Math.max(w.width,k.scrollWidth),height:w.height},...S];return{id:u.id,bounds:St(_,g,r.current)}});y(f),i(t.edges.flatMap(u=>{let k=n.current[u.source]?.getBoundingClientRect(),w=n.current[u.target]?.getBoundingClientRect();if(!k||!w)return[];let S=Z(k,u.leaves,g,r.current),_=f.find(z=>z.id===u.target)?.bounds,b=Ir(Lr(Z(w,u.enters,g,r.current),u.enters,_),u.enters),x=(Z(k,"bottom",g,r.current).y+Z(w,"top",g,r.current).y)/2,O=u.leaves==="left"?Math.min(S.x,b.x)-28:Math.max(S.x,b.x)+28;return[Mr(u,S,b,x,O)]}))};h(),window.addEventListener("resize",h);let m=new ResizeObserver(h);return r.current&&m.observe(r.current),()=>{window.removeEventListener("resize",h),m.disconnect()}},o),{links:a,extent:c,boxes:l}},de=jr;var ce=(t,r)=>{let n=new Set(r),o=t,a=2;for(;n.has(o);)o=`${t}_${a++}`;return o};var Wr=8,Fr={display:"flex",height:"100%",minHeight:0,fontSize:13},Vr={flex:1,overflow:"auto",position:"relative"},ue={position:"absolute",top:56,left:16,zIndex:5,width:264,padding:12,borderRadius:8},Yr={...ue,position:"static",alignSelf:"flex-start"},Ur={display:"grid",rowGap:64,columnGap:0,padding:40,justifyContent:"center",position:"relative"},Gr={position:"sticky",zIndex:8,top:8,margin:"8px auto 0",width:"fit-content",padding:"6px 12px",borderRadius:6,fontSize:12},Xr=({port:t,onCancel:r})=>e.createElement("div",{className:"bg-accent-100 text-accent-800 dark:bg-accent-900 dark:text-accent-100",style:Gr},"Choose the step \u201C",t||"next","\u201D should lead to \u2014 ",e.createElement("button",{onClick:r,className:"text-accent-800 underline dark:text-accent-100",style:{border:"none",background:"none",cursor:"pointer",fontSize:12,padding:0}},"cancel")),qr=({base:t,token:r,initial:n})=>{let{flow:o,error:a,notice:i,warning:c,setWarning:d,send:l,pickPicture:y}=le(t,r,n),[h,m]=C(null),[g,f]=C(null),[u,k]=C(null),[w,S]=C(null),[_,b]=C(null),[x,O]=C(!1),z=et({}),B=et(null);L(()=>{let s={open:null,publish:"/publish",save_draft:"/versions"},p=N=>{let D=N.target.closest?.("[data-bar-action]");if(!D||!(D.dataset.barAction in s))return;D.closest("details")?.removeAttribute("open"),m(null),O(!0);let F=s[D.dataset.barAction];F&&l(F,"POST")};return document.addEventListener("click",p),()=>document.removeEventListener("click",p)},[l]),L(()=>{if(!x){d(null);return}let s=p=>{p.target.isConnected&&!p.target.closest("[data-builder-panel], [data-open-panel], [data-bar-action]")&&O(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[x]),L(()=>{document.dispatchEvent(new CustomEvent("easy_flow:flow-named",{detail:o.flow?.title||o.flow?.slug}))},[o.flow?.title,o.flow?.slug]),L(()=>{document.dispatchEvent(new CustomEvent("easy_flow:flow-status",{detail:{status:o.flow?.status,publishes:o.flow?.publishes}}))},[o.flow?.status,o.flow?.publishes]);let xe=j(()=>Object.fromEntries(o.nodes.map(s=>[s.id,s])),[o.nodes]),{links:be,extent:ve,boxes:it}=de(o,B,z,[o,h,xe]),lt=j(()=>{let s={};return o.violations.forEach(p=>{var N;return(s[N=p.node]||(s[N]=[])).push(p)}),s},[o.violations]),E=o.direction==="left_to_right",H=o.nodes.filter(s=>!s.loose),dt=o.nodes.filter(s=>s.loose),we=Math.max(0,...H.map(s=>s.row))+1,ke=Math.max(0,...H.map(s=>s.column))+1,R=s=>{if(!u)return;let[p,N]=u;k(null),p!==s&&l("/edges","POST",{from:p,to:s,on:N||null})},Ce=s=>{if(s.isDefaultPrevented()||!w)return;s.preventDefault();let p=w;S(null);let N=B.current.getBoundingClientRect(),D=Nt(it,{x:s.clientX-N.left+B.current.scrollLeft,y:s.clientY-N.top+B.current.scrollTop}),F=o.nodes.find(Ne=>Ne.holds?.includes(p))?.id||null;D!==F&&l(`/steps/${p}/group`,"PATCH",{group:D})},ct=s=>[...o.palette,...o.unoffered||[]].find(p=>p.type===s?.type),M=o.nodes.find(s=>s.id===h),P=ct(M),tt=(s,p={})=>l("/steps","POST",{id:ce(s.type,o.nodes.map(N=>N.id)),type:s.type,from:p.from,to:p.to,on:p.on}),pt=s=>{let[p,N]=[_,w];b(null),S(null),p?tt(p,{from:s.source,to:s.target}):N&&l("/steps/"+N+"/move","PATCH",{from:s.source,to:s.target})},Se=s=>{let p=B.current.getBoundingClientRect();return{x:s.clientX-p.left+B.current.scrollLeft+8,y:s.clientY-p.top+B.current.scrollTop+8}},ut=s=>e.createElement(e.Fragment,null,s.placeholder&&e.createElement(Lt,{node:{...s,ref:p=>{z.current[s.id]=p}},dragging:!!w,compact:E,onFill:()=>f({from:s.from,on:s.on,at:{x:16,y:52}}),onDrop:()=>{let p=w;S(null),p&&l("/edges","POST",{from:s.from,to:p,on:s.on})}}),s.holds&&e.createElement(Y,{node:{...s,ref:p=>{z.current[s.id]=p}},header:U(s,ct(s),o.hide_step_type_codes),compact:E,onSelect:()=>u?R(s.id):m(s.id)}),!s.placeholder&&!s.holds&&e.createElement(ot,{node:{...s,ref:p=>{z.current[s.id]=p},violations:lt[s.id]||[],connected:o.edges.filter(p=>p.source===s.id).map(p=>p.label||null)},selected:s.id===h,armed:u&&u[0]===s.id?u[1]:null,connecting:!!u&&u[0]!==s.id,onSelect:()=>u?R(s.id):m(s.id),onOpen:p=>window.location.assign(p),onArm:(p,N)=>{let D=B.current.getBoundingClientRect();f({from:s.id,on:p,at:{x:N.clientX-D.left+B.current.scrollLeft+8,y:N.clientY-D.top+B.current.scrollTop+8}})},onDragEnd:()=>S(null),onDragStart:()=>S(s.id),hideStepTypeCodes:o.hide_step_type_codes,compact:E,branches:E?ee(s,o.edges,H).map(p=>re(p,o.nodes)):[]})),mt=dt.length>0&&e.createElement("div",{"data-loose":!0,className:"border border-dashed border-gray-300 bg-gray-50 dark:border-zinc-700 dark:bg-zinc-900",style:E?Yr:ue},e.createElement("div",{className:"text-gray-500 dark:text-gray-400",style:{fontSize:11,marginBottom:6}},"Not in the flow yet \u2014 drag one onto a connection"),dt.map(s=>e.createElement("div",{key:s.id,style:{marginBottom:8}},e.createElement(ot,{node:{...s,ref:p=>{z.current[s.id]=p},violations:lt[s.id]||[],connected:[]},selected:h===s.id,armed:u&&u[0]===s.id?u[1]:null,connecting:!!u,onSelect:()=>u?R(s.id):m(s.id),onOpen:p=>window.location.assign(p),onArm:(p,N)=>{N.stopPropagation(),k([s.id,p])},onDragStart:()=>S(s.id),onDragEnd:()=>S(null),hideStepTypeCodes:o.hide_step_type_codes}))));return e.createElement("div",{className:"text-gray-900 dark:text-gray-100",style:Fr,onMouseUp:()=>S(null),onKeyDown:s=>{s.key==="Escape"&&(m(null),k(null),f(null))},tabIndex:-1},e.createElement(Mt,{entries:o.palette,groups:o.step_groups||{},onPick:s=>tt(s),onCarry:b,onDrop:()=>b(null)}),e.createElement("div",{ref:B,className:"bg-surface-50 dark:bg-surface-950",style:Vr,onClick:s=>{s.target===B.current&&(m(null),k(null),O(!1))},onDragOver:s=>{w&&s.preventDefault()},onDrop:Ce},u&&e.createElement(Xr,{port:u[1],onCancel:()=>k(null)}),e.createElement(Ht,{undoable:o.undoable,redoable:o.redoable,onAdd:()=>f({at:{x:16,y:52}}),onUndo:()=>{m(null),l("/undo","POST")},onRedo:()=>{m(null),l("/redo","POST")}}),!E&&it.map(s=>e.createElement(Ct,{key:s.id,id:s.id,bounds:s.bounds,onDrop:()=>{let p=w;S(null),p&&l(`/steps/${p}/group`,"PATCH",{group:s.id})}})),!E&&e.createElement(Kt,{links:zt(be,o.nodes),extent:ve,dragging:w||_,alwaysShowInsertButtons:o.always_show_insert_buttons,onInsert:s=>f({from:s.source,to:s.target,at:{x:s.midX+30,y:s.midY}}),onRemove:s=>{m(null),l("/edges","DELETE",{from:s.source,to:s.target})},onDrop:pt}),!E&&mt,E&&e.createElement(Q,{nodes:H,edges:o.edges,draw:ut,joints:{alwaysShowInsertButtons:o.always_show_insert_buttons,dragging:!!(w||_),onInsert:(s,p)=>f({from:s.source,to:s.target,at:Se(p)}),onRemove:s=>{m(null),l("/edges","DELETE",{from:s.source,to:s.target})},onDrop:pt}},mt),!E&&e.createElement("div",{style:{...Ur,gridTemplateColumns:`repeat(${ke+1}, ${280/2}px)`,gridTemplateRows:`repeat(${we}, auto)`}},H.map(s=>e.createElement("div",{key:s.id,style:{gridRow:s.row+1,gridColumn:`${s.column+1} / span 2`,zIndex:2,marginTop:Bt(s,o.nodes)?Wr-64:0}},ut(s)))),g&&e.createElement(It,{entries:o.palette,at:g.at,onDismiss:()=>f(null),hideStepTypeCodes:o.hide_step_type_codes,onConnect:g.on!==void 0?()=>{k([g.from,g.on]),f(null)}:null,onPick:s=>{let p=g;f(null),tt(s,p)}})),x&&!M&&e.createElement(Gt,{flow:o.flow||{},changes:o.changes||[],problems:o.violations,refusal:a,notice:i,publishNote:o.publish_note,warning:c,onClose:()=>O(!1),onCreate:()=>l("/versions","POST"),onPublish:()=>l("/publish","POST"),onAccept:()=>l(c.path,"POST",{remove_unconnected:c.steps.map(s=>s.id)}),onDecline:()=>d(null),onSaveDetails:s=>l("/details","PATCH",{flow:s})}),M&&e.createElement($t,{node:M,fields:P?.fields||{},holds:P?.records||{},labels:P?.labels||{},explanations:P?.explanations||{},recordLabels:P?.record_labels||{},recordExplanations:P?.record_explanations||{},recordChoices:P?.record_choices||{},recordOutputsOf:P?.record_outputs_of||{},choices:_t(M,P),onClose:()=>m(null),onSave:s=>l(`/steps/${M.id}`,"PATCH",{config:s}),onPickPicture:y,refusal:a,onDelete:()=>{m(null),l(`/steps/${M.id}`,"DELETE")}}))},me=qr;var Jr={display:"block",minWidth:118,boxSizing:"border-box",borderRadius:6,padding:"8px 10px",textDecoration:"none"},Kr={fontSize:12,fontWeight:500,lineHeight:1.3},fe={done:"border-green-600 bg-green-50 dark:border-green-500 dark:bg-green-950",paused:"border-amber-500 bg-amber-50 dark:border-amber-400 dark:bg-amber-950",pending:"border-gray-300 bg-white text-gray-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-gray-400",failed:"border-red-600 bg-red-50 dark:border-red-500 dark:bg-red-950"},ge={done:"text-green-700 dark:text-green-400",paused:"text-amber-800 dark:text-amber-300",pending:"text-gray-500 dark:text-gray-400",failed:"text-red-700 dark:text-red-400"},Qr="ring-2 ring-accent-600 ring-offset-2 dark:ring-offset-zinc-950",Zr=({node:t,selected:r=!1})=>{let n=t.address?"a":"div";return e.createElement(n,{"data-step":t.id,href:t.address||void 0,className:`${t.state==="paused"?"border-2":"border"} ${fe[t.state]||fe.pending}${r?` ${Qr}`:""}`,style:Jr},e.createElement("div",{className:"font-mono text-gray-500 dark:text-gray-400",style:{fontSize:11}},t.type),e.createElement("div",{style:Kr},t.label,t.version&&e.createElement("span",{className:"text-gray-500 dark:text-gray-400",style:{fontWeight:400,marginLeft:4}},t.version)),t.status&&e.createElement("div",{className:ge[t.state]||ge.pending,style:{fontSize:11}},t.status))},he=Zr;var Rr={gap:12,padding:0},to=({nodes:t,edges:r,selected:n})=>e.createElement(Q,{nodes:t,edges:r,joints:{},style:Rr,draw:o=>o.holds?e.createElement(Y,{node:o,header:U(o,o,!1),compact:!0}):e.createElement(he,{node:o,selected:o.id===n})}),ye=to;rt("easy_flow/flow-editor",me);rt("easy_flow/run-view",ye);document.addEventListener("easy_flow:flow-named",t=>{let r=document.querySelector("[data-flow-heading]");r&&(r.textContent=t.detail)});document.addEventListener("easy_flow:flow-status",({detail:t})=>{t.status&&document.querySelectorAll("[data-version-status]").forEach(r=>{r.textContent=t.status}),t.publishes&&document.querySelectorAll("[data-bar-action=publish]").forEach(r=>{r.textContent=`Publish v${t.publishes}`})});vt(document,ft);})();
|
|
@@ -3,11 +3,12 @@ import { toggled } from "./choices"
|
|
|
3
3
|
import Input from "keystone_ui-react/src/Input.jsx"
|
|
4
4
|
import Select from "keystone_ui-react/src/Select.jsx"
|
|
5
5
|
import Checkbox from "keystone_ui-react/src/Checkbox.jsx"
|
|
6
|
+
import RadioCards from "keystone_ui-react/src/RadioCards.jsx"
|
|
6
7
|
|
|
7
8
|
const offered = (choices) =>
|
|
8
9
|
(choices || []).map((choice) => (typeof choice === "object" ? choice : { value: choice, label: choice }))
|
|
9
10
|
|
|
10
|
-
const Control = ({ type, value, choices, onChange, onSettle, onPick, pictureUrl }) => {
|
|
11
|
+
const Control = ({ name, type, value, choices, onChange, onSettle, onPick, pictureUrl }) => {
|
|
11
12
|
if (type === "picture") {
|
|
12
13
|
return <div className="mb-3">
|
|
13
14
|
{value && pictureUrl && <img src={pictureUrl} alt="The step's picture" style={{ maxWidth: "100%" }} />}
|
|
@@ -25,6 +26,12 @@ const Control = ({ type, value, choices, onChange, onSettle, onPick, pictureUrl
|
|
|
25
26
|
</Select>
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
if (type === "radio_cards") {
|
|
30
|
+
return <div data-radio-cards className="mb-3 [&_label]:flex-[1_1_7rem] [&_.ks-radio-card]:flex [&_.ks-radio-card]:h-full">
|
|
31
|
+
<RadioCards name={name} value={value} options={choices || []} onChange={(e) => onSettle(e.target.value)} />
|
|
32
|
+
</div>
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
if (type === "multi_select") {
|
|
29
36
|
const chosen = Array.isArray(value) ? value : []
|
|
30
37
|
const toggle = (choice) => onSettle(toggled(chosen, choice))
|
|
@@ -37,7 +37,7 @@ const Inspector = ({ node, fields, holds, labels, explanations, recordLabels, re
|
|
|
37
37
|
outputsOf={(recordOutputsOf || {})[name]}
|
|
38
38
|
onChange={(next) => setDraft({ ...draft, [name]: next })}
|
|
39
39
|
onSettle={(next) => settle({ ...draft, [name]: next })} />
|
|
40
|
-
: <Control type={type} value={draft[name]} choices={choices[name]} pictureUrl={pictureUrl}
|
|
40
|
+
: <Control name={name} type={type} value={draft[name]} choices={choices[name]} pictureUrl={pictureUrl}
|
|
41
41
|
onChange={(next) => setDraft({ ...draft, [name]: next })}
|
|
42
42
|
onSettle={(next) => settle({ ...draft, [name]: next })}
|
|
43
43
|
onPick={async (file) => {
|
|
@@ -79,10 +79,14 @@ module EasyFlow
|
|
|
79
79
|
offered = choices[name]
|
|
80
80
|
return unless offered
|
|
81
81
|
|
|
82
|
-
stray = Array(value).find { |chosen| offered.exclude?(chosen) }
|
|
82
|
+
stray = Array(value).find { |chosen| values_of(offered).exclude?(chosen) }
|
|
83
83
|
"#{labels[name]} does not offer #{stray}" if stray
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
def values_of(offered)
|
|
87
|
+
offered.map { |choice| choice.is_a?(Hash) ? choice.stringify_keys["value"] : choice }
|
|
88
|
+
end
|
|
89
|
+
|
|
86
90
|
def over_limit(name, value)
|
|
87
91
|
allowed = @limits[name]
|
|
88
92
|
return unless allowed && Array(value).size > allowed
|
|
@@ -147,7 +147,7 @@ module EasyFlow
|
|
|
147
147
|
|
|
148
148
|
def declare_choices(name, type, options)
|
|
149
149
|
return @choices[name] = options if options.present?
|
|
150
|
-
raise UnknownFieldType, "a #{type} must offer options" if %i[select multi_select].include?(type)
|
|
150
|
+
raise UnknownFieldType, "a #{type} must offer options" if %i[select multi_select radio_cards].include?(type)
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
def declare_entries(name, entries)
|
data/lib/easy_flow/version.rb
CHANGED
data/lib/easy_flow.rb
CHANGED
|
@@ -7,7 +7,7 @@ require "easy_flow/host_routes"
|
|
|
7
7
|
require "easy_flow/engine"
|
|
8
8
|
|
|
9
9
|
module EasyFlow
|
|
10
|
-
FIELD_TYPES = %i[string integer float boolean select multi_select previous_step from_step list flow flows picture].freeze
|
|
10
|
+
FIELD_TYPES = %i[string integer float boolean select multi_select radio_cards previous_step from_step list flow flows picture].freeze
|
|
11
11
|
|
|
12
12
|
OUTPUT_TYPES = %i[string integer float boolean].freeze
|
|
13
13
|
OPTIONAL_CHECKS = %i[unrouted_value unfollowed_path dead_end].freeze
|
|
@@ -83,7 +83,7 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
|
|
|
83
83
|
4. Ask the developer which hosts' admins should be able to add the type. A registered type is in a host's palette, the step types an admin can add on that host's canvas, only when the host names no list of offered step types or its list includes the type's id. A type that declares `ends_here` is in every host's palette, and a type that declares `begins_here` is in none. When a host that names a list should offer the new type, add the type's id to that host's list through `easy_flow-install`. Leaving a type off a host's list only keeps admins from adding it there, and a step of that type already in one of the host's flows is still drawn and run, and still opens with all its settings and can be saved.
|
|
84
84
|
5. Use these words to declare the type. Each is called once at class level (or inside the `EasyFlow.step` block):
|
|
85
85
|
- `step_name "<label>"` — the name admins see on the canvas. Defaults to the id.
|
|
86
|
-
- `setting :name, type:, label:, explanation:, options:, required:, optional:, limit:, check:, from:, outputs_of:, kept_on:, attribute:` — a field the admin fills in on the canvas. `type` is one of `:string`, `:integer`, `:float`, `:boolean`, `:select`, `:multi_select`, `:previous_step`, `:from_step`, `:list`, `:flow`, or boot raises `EasyFlow::UnknownFieldType`. A `:select` or `:
|
|
86
|
+
- `setting :name, type:, label:, explanation:, options:, required:, optional:, limit:, check:, from:, outputs_of:, kept_on:, attribute:` — a field the admin fills in on the canvas. `type` is one of `:string`, `:integer`, `:float`, `:boolean`, `:select`, `:multi_select`, `:radio_cards`, `:previous_step`, `:from_step`, `:list`, `:flow`, or boot raises `EasyFlow::UnknownFieldType`. A `:select`, `:multi_select` or `:radio_cards` must pass `options:`, or boot raises the same error. A `:radio_cards` setting is drawn in the step's settings as one keystone radio card per option, side by side with each card taking an equal share of the row, and one card per row when the panel is too narrow; its `options:` are hashes `{ value:, label:, hint: }`, as a fixed array or a lambda that works them out from the app's records (`options: -> { Release.aliases.map { |release| { value: release.alias, label: "#{release.alias} → #{release.version}", hint: release.stats_line } } }`), the chosen card's `value` is stored in `node.config`, and a saved value that is not one of the options' values is refused. `options:` is either an array of strings, or a lambda taking no arguments that returns one; the lambda is called each time the canvas is opened and each time an admin saves the step's settings, so the options follow the app's data without a restart (`options: -> { Region.order(:name).pluck(:code) }`). A saved setting whose value is no longer among the options is refused the next time the admin saves that step. When the options come from the app's records, ask the developer which records, which column is stored as the value, and whether the list must differ by account or host, since the lambda is passed nothing and the same list is offered everywhere the type is used. A `:list` must take a block of `setting` calls describing one entry. `:previous_step` lets the admin pick an earlier step, and is required unless declared with `optional: true`. Ask the developer whether a step of the type may be left without that earlier step, and when it may, declare `optional: true` and handle a blank value in the type's code. `outputs_of: :<setting>` offers the outputs of the step chosen in that setting, and `from: :<setting>` offers the values of the output chosen in that setting; either one makes the type `:from_step`. A required setting left blank shows a warning on the step's card that the step `needs a value for <label>`, and saving the flow as a new version and publishing it are refused until the admin fills it in. An `outputs_of:` setting left blank is flagged and refused the same way once the setting it reads names a step, whether or not it is declared `required:`. Inside a `:list` entry, a blank required setting, or a blank `outputs_of:` setting whose step is picked, shows `needs a value for <label> in <list label> entry <n>` for the entry at position `n` counting from 1. `optional:` has no effect inside a `:list` entry, where a `:previous_step` is required only when declared `required: true`. `:flow` lets the admin pick one of the flows the admin's list shows on the same host, offered by title, and is stored in `node.config` as that flow's id as a string. A `:flow` setting is not checked on save against the flows offered, so code that reads it looks the flow up through the host and handles a blank or unknown id. `limit:` is the most values a `:multi_select` takes. `check:` is a lambda given the value that returns an error message, or `nil` when the value is acceptable. `label:` defaults to the name humanized. `explanation:` is an optional sentence shown under the setting in the step's settings, inside a `:list` entry as well, and a setting with none shows nothing there. A host can replace it with its own through `setting_explanations`, set through `easy_flow-install`. `kept_on:` and `attribute:` keep the setting's value on one of the app's own records instead of in the flow; see "Keep a setting on one of the app's records".
|
|
87
87
|
- `output :name, type:, label:, values:, from:` — a value the step records. `type` is one of `:string`, `:integer`, `:float`, `:boolean`, or boot raises `EasyFlow::UnknownOutputType`. `values:` is an array or a lambda taking the node, listing the values the output can take; the canvas offers these as the connections leaving the step, so a type that routes must declare them. `from: :<setting>` takes the values from the step chosen in that setting. A Condition step requires the admin to pick one of the earlier step's outputs, so a type whose answer admins should test with a Condition declares at least one `output`, with `values:` so the Condition offers answers to pick.
|
|
88
88
|
- `outputs_named_by :<list setting>` — adds one output for each entry an admin enters in that `:list` setting, named by the entry's `name`, so the setting's entry block must declare `setting :name, type: :string`. Ask the developer whether the admin or the type decides the names of the values the step records. Do not pick.
|
|
89
89
|
- The named outputs follow any outputs the type declares with `output`, in the order the admin entered them. An entry with a blank `name` adds none.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: easy_flow-info
|
|
3
|
-
description: Use to learn what easy_flow offers — guided flows an admin draws on a canvas and a visitor runs one step at a time, versioned documents of steps and connections, flows that loop back to ask a step again, a loop that stops a run when nothing new was answered and the step it came back to, whether a run ended at an End step, hosts and the step types each offers its admins, runs and the published version each starts on, each visit a run records with its value and the time the step was completed, and the output a flow gives when it ends, the built-in step types including questions and checklists that can require an answer and explain each answer behind an info button, file upload steps that hand a visitor's file to the app's file store and read it back by its name, and branching on an answer, including one named output of a step that recorded several, on comparing a number with an amount, or on comparing two earlier answers or one earlier answer with an amount alone, steps flagged when they name an earlier step without choosing which of its outputs to read, branching on a list of such comparisons that must all hold or of which any one must hold, branching on the hour, weekday or minute a step was completed, Wait steps that hold a run until a number of minutes or a time of day after an earlier step was completed, or until a date, and are named after what they wait for, the Check again button a visitor sees at a waiting step in a flow that keeps nothing, Count steps that count how often an earlier step was answered so a loop can give up after a number of tries, Flow steps that name another flow, open its canvas when their card is clicked with a button back to the flow it was opened from, start a run of it for the same owner when a stored run reaches them, are flagged when the flow or version they name cannot run or leads back to the flow they sit in, let the waiting run name that inner run, move that run on along the output it ends with, leave it waiting when the inner run is stopped by a loop, and fail with an error naming the step when its version was taken out of service or its inner run ended with no output, removing a flow and why it is refused while a waiting run depends on it, step types the host app registers, including ones whose outputs are named by the entries an admin lists in one of their settings, ones that start another flow and work out which flow and version to run from their own settings and are named after that flow, or choose it from the run they are in, the answers a host allows a step in a run and the steps it fills in or passes over, the checks they make on an answer, what a step shows a visitor and how that can depend on the visitor's run, and steps that hold a run until something outside the flow has happened, group steps drawn as a box an admin drags steps into and out of, and the settings an admin fills in, including picks whose options come from the app's data and settings kept on one of the app's own records.
|
|
3
|
+
description: Use to learn what easy_flow offers — guided flows an admin draws on a canvas and a visitor runs one step at a time, versioned documents of steps and connections, flows that loop back to ask a step again, a loop that stops a run when nothing new was answered and the step it came back to, whether a run ended at an End step, hosts and the step types each offers its admins, runs and the published version each starts on, each visit a run records with its value and the time the step was completed, and the output a flow gives when it ends, the built-in step types including questions and checklists that can require an answer and explain each answer behind an info button, file upload steps that hand a visitor's file to the app's file store and read it back by its name, and branching on an answer, including one named output of a step that recorded several, on comparing a number with an amount, or on comparing two earlier answers or one earlier answer with an amount alone, steps flagged when they name an earlier step without choosing which of its outputs to read, branching on a list of such comparisons that must all hold or of which any one must hold, branching on the hour, weekday or minute a step was completed, Wait steps that hold a run until a number of minutes or a time of day after an earlier step was completed, or until a date, and are named after what they wait for, the Check again button a visitor sees at a waiting step in a flow that keeps nothing, Count steps that count how often an earlier step was answered so a loop can give up after a number of tries, Flow steps that name another flow, open its canvas when their card is clicked with a button back to the flow it was opened from, start a run of it for the same owner when a stored run reaches them, are flagged when the flow or version they name cannot run or leads back to the flow they sit in, let the waiting run name that inner run, move that run on along the output it ends with, leave it waiting when the inner run is stopped by a loop, and fail with an error naming the step when its version was taken out of service or its inner run ended with no output, removing a flow and why it is refused while a waiting run depends on it, step types the host app registers, including ones whose outputs are named by the entries an admin lists in one of their settings, ones that start another flow and work out which flow and version to run from their own settings and are named after that flow, or choose it from the run they are in, the answers a host allows a step in a run and the steps it fills in or passes over, the checks they make on an answer, what a step shows a visitor and how that can depend on the visitor's run, and steps that hold a run until something outside the flow has happened, group steps drawn as a box an admin drags steps into and out of, and the settings an admin fills in, including picks whose options come from the app's data, choices drawn as radio cards with a hint under each, and settings kept on one of the app's own records.
|
|
4
4
|
tools: Read
|
|
5
5
|
scope: guided flows — versioned documents of steps and the connections between them, drawn on a canvas by an admin and run by a visitor one step at a time, with step types the host registers
|
|
6
6
|
---
|
|
@@ -54,8 +54,8 @@ easy_flow declares no commands of its own for this local. Its surface is split b
|
|
|
54
54
|
- **Step type** — what a kind of step is: its display name, its settings (the fields an admin fills in), its outputs (the values it records), and whether it waits for the visitor, acts on its own, or waits for something outside the flow. A step that acts on its own may record a value worked out from the answers so far, pick which connection to follow, or both.
|
|
55
55
|
- **Display** — what a step type hands the visitor's page to draw a step, such as its question text and its answers. A step type may build its display from the step alone, or from the step and the visitor's stored run, so the same step can show something different to each visitor. There is no stored run in an admin's preview or in a flow that carries its answers in the page, and the display is then built without one. A host can draw a single-choice, multiple-select or fill-in-the-blank step with an answer already chosen by passing it as `chosen`, and the step is drawn blank when none is passed.
|
|
56
56
|
- **Answer check** — a rule a step type may carry that looks at a visitor's answer and, when the answer is not acceptable, returns the message the visitor sees. A step type with no such rule accepts every answer.
|
|
57
|
-
- **Setting** — one field an admin fills in when configuring a step on the canvas. A step type may give a setting a one-sentence explanation, which shows under it in the step's settings. It is text, a whole number, a decimal, a yes or no, a pick from a list, several picks from a list, an earlier step, an earlier step's output, another flow of the same host, or a list of entries that each hold their own fields. A setting can be required, limited to a number of picks, or checked by a rule the step type supplies.
|
|
58
|
-
- **Options** — the values a pick-from-a-list setting offers. They are either a fixed list written into the step type, or a lookup the app provides that is read each time the canvas or a save asks for them, so they can come from the app's own data. A saved value that is not among the options is refused.
|
|
57
|
+
- **Setting** — one field an admin fills in when configuring a step on the canvas. A step type may give a setting a one-sentence explanation, which shows under it in the step's settings. It is text, a whole number, a decimal, a yes or no, a pick from a list, a pick from a few choices drawn as radio cards side by side with a hint under each, several picks from a list, an earlier step, an earlier step's output, another flow of the same host, or a list of entries that each hold their own fields. A setting can be required, limited to a number of picks, or checked by a rule the step type supplies.
|
|
58
|
+
- **Options** — the values a pick-from-a-list setting offers, and for a radio card setting each value's label and hint. They are either a fixed list written into the step type, or a lookup the app provides that is read each time the canvas or a save asks for them, so they can come from the app's own data. A saved value that is not among the options is refused.
|
|
59
59
|
- **Kept setting** — a setting whose value lives on one of the app's own records rather than in the flow. The step type says how to find that record from the step's other settings and which of its attributes holds the value. The canvas shows the value read from the record, and saving the step's settings writes it straight to the record, so the flow's document and its versions never hold it and undo or publishing does not change it. When no record is found, nothing is written. When the record refuses a value, the save is refused with the record's own error and none of the step's kept settings are written.
|
|
60
60
|
- **Output** — a value a step records into the run, with a type and a label. Later steps read outputs, and a setting that points at an earlier step offers that step's known values on the canvas. A step type may also take further outputs from a list setting, one for each entry the admin gives a name, labelled with that name written as a phrase, such as "First reading" for `first_reading`. An entry left without a name adds no output. Those outputs are offered wherever the step's declared outputs are, such as when a Condition, Compare, Compare two values, All of or Any of or Count step picks which output to read.
|
|
61
61
|
- **Chosen output** — which of an earlier step's outputs a step reads. Every built-in step that names an earlier step and then reads one of its outputs asks the admin to pick that output, as does a step type of the app's own whose output setting points at a step setting. Once the earlier step is named, a step with no output picked is reported as missing that setting, and the same holds for each comparison in an All of or Any of list, for its first step and for its second step. A step that names no earlier step, such as a Compare two values step with its second step left empty, is not asked for that step's output.
|