@w6w/ui 0.2.69 → 0.2.70
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.
- package/CHANGELOG.md +5 -0
- package/dist/components/ExecutionFilters.d.ts +10 -1
- package/dist/components/ExecutionList.d.ts +4 -0
- package/dist/components/ExecutionLogPanel.d.ts +8 -0
- package/dist/{connection-app-meta-CDnfX_dN.js → connection-app-meta-BmmWB5fn.js} +2 -2
- package/dist/connection-app-meta-BmmWB5fn.js.map +1 -0
- package/dist/{connection-app-meta-ChRGxZex.cjs → connection-app-meta-CQ85y_6M.cjs} +3 -3
- package/dist/connection-app-meta-CQ85y_6M.cjs.map +1 -0
- package/dist/flow.cjs +6 -6
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.mjs +21 -3
- package/dist/flow.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1974 -1857
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_execution-history.scss +19 -0
- package/src/styles/_execution-log-view.scss +77 -8
- package/src/styles/_execution-log.scss +13 -1
- package/src/styles.css +116 -9
- package/dist/connection-app-meta-CDnfX_dN.js.map +0 -1
- package/dist/connection-app-meta-ChRGxZex.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";const n=require("react/jsx-runtime"),b=require("react"),le=require("@w6w/expr"),Wn=require("@codemirror/lang-javascript"),ur=require("@codemirror/lang-python"),Ys=require("@codemirror/view"),dr=require("@uiw/react-codemirror"),ue=require("./CodeBlock-85y9qvE3.cjs"),pr=require("@codemirror/lang-json"),na=require("@codemirror/lint"),Un=require("react-dom"),Es=require("@xyflow/react"),$l=require("react-markdown");var ws=typeof document<"u"?document.currentScript:null;const Pl={ai:"AI",cms:"CMS",crm:"CRM",hr:"HR",devops:"DevOps"};function _l(e){if(typeof e!="string"||e.trim()==="")return"";const t=Pl[e];return t||e.split(/[-_\s]+/).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Fl(e){const t=new Map;for(const s of e)for(const o of s.categories??[])t.set(o,(t.get(o)??0)+1);return[...t.entries()].map(([s,o])=>({slug:s,label:_l(s),count:o})).sort((s,o)=>o.count-s.count||s.label.localeCompare(o.label,void 0,{sensitivity:"base"}))}function Ll(e,t){if(t.length===0)return!0;const s=e.categories??[];return t.some(o=>s.includes(o))}const Ml=["text","textarea","email","number","phone","url","password","date","time","datetime","select","radio","checkboxes","checkbox","rating","file","hidden","heading","paragraph","pageBreak"],Dl=new Set(["heading","paragraph","pageBreak"]),Zn=new Set(["select","radio","checkboxes"]),ql=new Set(["text","textarea","email","phone","url","password"]);function fr(e){return!Dl.has(e)}const hr=["equals","notEquals","contains","notContains","isEmpty","isNotEmpty","greaterThan","lessThan"],bs=200,mr=1e3,Wl=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,Ul=new Set(["__proto__","constructor","prototype"]),Bl="#4f46e5",Hl=[{name:"--bg",light:"#f5f6fa",dark:"#0f1115",use:"page background"},{name:"--card",light:"#ffffff",dark:"#181b21",use:"the box around the form"},{name:"--text",light:"#16181d",dark:"#eceef2",use:"text"},{name:"--muted",light:"#5d6472",dark:"#9aa1ad",use:"descriptions and help text"},{name:"--border",light:"#d9dce3",dark:"#2c313a",use:"borders and empty stars"},{name:"--input",light:"#ffffff",dark:"#11141a",use:"input background"},{name:"--err",light:"#c0262d",dark:"#ff6b6b",use:"errors and the required *"},{name:"--errbg",light:"#fdecec",dark:"#3a1a1c",use:"error banner background"},{name:"--ok",light:"#15803d",dark:"#4ade80",use:"the completion tick"}],zl=[{rule:".wrap { max-width: 680px; }",use:"the form's column"},{rule:".card { border-radius: 14px; padding: 32px; }",use:"the box around the form"},{rule:"h1 { font-size: 1.6rem; }",use:"the title"},{rule:".desc { }",use:"the description"},{rule:".field { }",use:"one question"},{rule:".q { }",use:"a question's label"},{rule:".help { }",use:"a question's help text"},{rule:".choice { }",use:"one radio or checkbox option"},{rule:".drop { }",use:"the file upload area"},{rule:".primary { }",use:"the Submit / Next button"},{rule:".secondary { }",use:"the Back button"},{rule:".foot { }",use:"the footer"}];function Vl(){const e=(s,o)=>s+" ".repeat(Math.max(1,o-s.length)),t=s=>Hl.map(o=>` ${e(`/* ${o.name}: ${s?o.dark:o.light}; */`,28)}/* ${o.use} */`);return["/* Custom CSS for the form page. Uncomment a line to use it. */","","/* Colours */",":root {",` ${e(`/* --accent: ${Bl}; */`,28)}/* buttons, focus rings, progress (or set Accent colour) */`,...t(!1),"}","","/* Dark colours: used when Theme is auto and the visitor's system is dark. */","/* (With Theme dark or light, set the colours in :root above.) */","@media (prefers-color-scheme: dark) {"," :root {",...t(!0).map(s=>` ${s}`)," }","}","","/* Page parts */",...zl.map(s=>`${e(`/* ${s.rule} */`,52)}/* ${s.use} */`),""].join(`
|
|
2
|
-
`)}function wr(){return{version:1,title:"Contact us",description:"We'll get back to you within one business day.",fields:[{id:"f_name",type:"text",name:"name",label:"Name",required:!0,width:"half"},{id:"f_email",type:"email",name:"email",label:"Email",required:!0,width:"half",placeholder:"you@example.com"},{id:"f_message",type:"textarea",name:"message",label:"Message",required:!0}],submitLabel:"Submit",completion:{type:"message",title:"Thank you!",message:"Your response has been recorded."},settings:{allowPrefill:!0,showProgress:!0,theme:"auto"}}}function Jl(e,t,s){const o={id:t,type:e};if(e==="pageBreak")return{...o,label:""};if(e==="heading")return{...o,label:"Section title"};if(e==="paragraph")return{...o,help:"Some helpful text."};const a=br[e],r={...o,label:a,name:Xs(yr(a),s)};return Zn.has(e)&&(r.options=[{label:"Option 1"},{label:"Option 2"}]),e==="rating"&&(r.max=5),e==="checkbox"&&(r.label="I agree"),r}const br={text:"Short text",textarea:"Long text",email:"Email",number:"Number",phone:"Phone",url:"Website",password:"Password",date:"Date",time:"Time",datetime:"Date & time",select:"Dropdown",radio:"Single choice",checkboxes:"Multiple choice",checkbox:"Checkbox",rating:"Rating",file:"File upload",hidden:"Hidden value",heading:"Heading",paragraph:"Paragraph",pageBreak:"Page break"};function yr(e){const t=e.toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48);return t?/^[0-9]/.test(t)?`f_${t}`:t:"field"}function Xs(e,t){if(!t.has(e))return e;let s=2;for(;t.has(`${e}_${s}`);)s++;return`${e}_${s}`}const Ze=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),we=e=>typeof e=="string"?e:void 0,sa=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0;function Kl(e){var l;let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return null}if(!Ze(t)||!Array.isArray(t.fields))return null;const s=[],o=[],a=new Set,r=new Set;for(const[c,u]of t.fields.slice(0,bs).entries()){if(!Ze(u)){s.push({message:`Field ${c+1} is not an object.`});continue}const d=we(u.type);if(!d||!Ml.includes(d)){s.push({message:`Field ${c+1} has an unknown type "${String(u.type)}".`});continue}let p=we(u.id)||`f_${c+1}`;r.has(p)&&(p=Xs(p,r)),r.add(p);const f=Gl(u,p,d);if(fr(d)&&(!f.name||!Wl.test(f.name)||Ul.has(f.name)?s.push({fieldId:p,message:`"${f.label||d}" needs a name made of letters, digits and _ (starting with a letter).`}):a.has(f.name)&&s.push({fieldId:p,message:`Two fields are named "${f.name}".`}),f.name&&a.add(f.name),Zn.has(d)&&!((l=f.options)!=null&&l.length)&&!f.optionsFrom&&s.push({fieldId:p,message:`"${f.label||f.name}" has no options.`}),f.pattern!==void 0))try{new RegExp(f.pattern)}catch{s.push({fieldId:p,message:`"${f.label||f.name}" has an invalid pattern.`})}const h=f.showIf;if(h&&!o.some(m=>m.name===h.field)){const m=f.label||f.name||d;s.push({fieldId:p,message:`"${m}" depends on "${h.field}", which is not an earlier field.`})}o.push(f)}t.fields.length>bs&&s.push({message:`A form holds at most ${bs} fields.`});const i={version:1,title:we(t.title)??"",fields:o};if(i.title.trim()||s.push({message:"The form needs a title."}),we(t.description)&&(i.description=we(t.description)),we(t.submitLabel)&&(i.submitLabel=we(t.submitLabel)),Ze(t.completion)){const c=t.completion,u={type:c.type==="redirect"?"redirect":"message"};we(c.title)!==void 0&&(u.title=we(c.title)),we(c.message)!==void 0&&(u.message=we(c.message)),we(c.redirectUrl)!==void 0&&(u.redirectUrl=we(c.redirectUrl)),c.allowAnother===!0&&(u.allowAnother=!0),u.type==="redirect"&&!Xl(u.redirectUrl)&&s.push({message:"The redirect URL must start with http:// or https://."}),i.completion=u}if(Ze(t.settings)){const c=t.settings,u={};typeof c.allowPrefill=="boolean"&&(u.allowPrefill=c.allowPrefill),typeof c.showProgress=="boolean"&&(u.showProgress=c.showProgress),(c.theme==="light"||c.theme==="dark"||c.theme==="auto")&&(u.theme=c.theme),typeof c.accentColor=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(c.accentColor)&&(u.accentColor=c.accentColor),we(c.customCss)&&(u.customCss=we(c.customCss)),c.hideBranding===!0&&(u.hideBranding=!0),c.closed===!0&&(u.closed=!0),we(c.closedMessage)&&(u.closedMessage=we(c.closedMessage)),i.settings=u}return{form:i,problems:s}}function Gl(e,t,s){const o={id:t,type:s};for(const r of["name","label","help","placeholder","pattern","patternMessage"]){const i=we(e[r]);i!==void 0&&i!==""&&(o[r]=i)}for(const r of["minDate","maxDate","accept"]){const i=we(e[r]);i&&(o[r]=i)}e.required===!0&&(o.required=!0),e.multiple===!0&&(o.multiple=!0),e.allowOther===!0&&(o.allowOther=!0);for(const r of["minLength","maxLength","min","max","step","minSelected","maxSelected","rows","maxFileSizeMb","maxFiles"]){const i=sa(e[r]);i!==void 0&&(o[r]=i)}const a=e.defaultValue;if((typeof a=="string"||typeof a=="boolean"||sa(a)!==void 0||Array.isArray(a)&&a.every(r=>typeof r=="string"))&&(o.defaultValue=a),Array.isArray(e.options)&&(o.options=e.options.flatMap(r=>{if(typeof r=="string")return r?[{label:r}]:[];if(!Ze(r))return[];const i=we(r.label)??we(r.value);if(!i)return[];const l={label:i};return we(r.value)&&(l.value=we(r.value)),[l]})),Zn.has(s)){const r=oa(e.optionsFrom);r&&(o.optionsFrom=r,Array.isArray(r.items)&&(o.options=ra(r.items,r)))}if(s==="text"){if(Array.isArray(e.suggestions)){const i=e.suggestions.filter(l=>typeof l=="string"&&l!=="");i.length&&(o.suggestions=i.slice(0,mr))}const r=oa(e.suggestionsFrom);r&&(o.suggestionsFrom=r,Array.isArray(r.items)&&(o.suggestions=[...new Set(ra(r.items,r).map(i=>i.label))]))}if(e.width==="half"&&(o.width="half"),Ze(e.showIf)&&we(e.showIf.field)){const r=hr.includes(String(e.showIf.op))?e.showIf.op:"equals";o.showIf={field:String(e.showIf.field),op:r},e.showIf.value!==void 0&&e.showIf.value!==null&&(o.showIf.value=String(e.showIf.value))}return o}function oa(e){var a,r;if(!Ze(e)||e.items===void 0||e.items===null||e.items==="")return;const t={items:e.items},s=(a=we(e.label))==null?void 0:a.trim(),o=(r=we(e.value))==null?void 0:r.trim();return s&&(t.label=s),o&&(t.value=o),t}function Yl(e,t){let s=e;for(const o of t.split(".")){if(!Ze(s)||!Object.hasOwn(s,o))return;s=s[o]}return s}function aa(e){if(typeof e=="string")return e===""?void 0:e;if(typeof e=="number"&&Number.isFinite(e)||typeof e=="boolean")return String(e)}function ra(e,t={}){const s=[],o=new Set,a=(r,i)=>{for(const l of i){const c=aa(Yl(r,l));if(c!==void 0)return c}};for(const r of e){if(s.length>=mr)break;let i,l;if(Ze(r)){const c=a(r,t.value?[t.value]:["value","id"]);i=a(r,t.label?[t.label]:["label","name","title"])??c,l=c??i}else i=l=aa(r);i===void 0||l===void 0||o.has(l)||(o.add(l),s.push(l===i?{label:i}:{label:i,value:l}))}return s}function Xl(e){return typeof e=="string"&&/^https?:\/\/\S+$/i.test(e.trim())}function kn(e,t){const s=e==="error"?{className:"w6w-edge-error",label:"on error"}:e==="each"?{className:"w6w-edge-each"}:{};if(!t)return s;const o=t==="taken"?"w6w-edge-taken":"w6w-edge-skipped";return{className:s.className?`${s.className} ${o}`:o,...s.label?{label:s.label}:{}}}const Qs="out-error",es="out-each",et="done",gr="each";function Zs(e){return e==="error"?Qs:e==="each"?es:void 0}function Ql(e){return e===Qs?"error":e===es?"each":"success"}const Zl="@w6w/",Se="@w6w/control",xr="@w6w/script",fn="@w6w/data",Yt="@w6w/trigger",ec="@w6w/http",Ke="@w6w/webhook",eo="@w6w/scheduler",mt="@w6w/form",tc="@w6w/respond",jn="@w6w/call",to="@w6w/document",Tn="@w6w/model",nc="@w6w/template",On="@w6w/regex",sc="@w6w/string",oc="@w6w/number",Je="@w6w/store",qt="@w6w/csv",ac="@w6w/files",rc="@w6w/datetime",ic="@w6w/crypto",lc="@w6w/list",no="@w6w/stop",nt="@w6w/router",Xt="@w6w/race",vr="Continue once with the first arriving path’s output. Later arrivals are ignored for this run. Other paths keep running.";function so(e){var t;return e.uses.app!==nt||!Array.isArray((t=e.with)==null?void 0:t.routes)?[]:e.with.routes.filter(s=>!!s&&typeof s=="object"&&typeof s.id=="string")}const Qt=e=>`route:${e}`,cc=e=>e!=null&&e.startsWith("route:")?e.slice(6):void 0,uc=3,dc=16;function pc(e){const t=e.find(a=>a.default),s=a=>({id:a.id,handleId:Qt(a.id),label:a.default?"Fallback":a.label||a.id}),o=e.filter(a=>a!==t);return{right:o.map((a,r)=>({...s(a),top:`${(r+.5)/o.length*100}%`})),...t?{bottom:s(t)}:{},...o.length>uc?{minHeight:o.length*dc}:{}}}const Bn="false";function oo(e){return e.uses.app===Se&&e.uses.action==="if"}function fc(){return{right:[{id:"true",label:"True",top:"50%"}],bottom:{id:Bn,handleId:Qt(Bn),label:"False"}}}function pt(e){return e.startsWith(Zl)}function Ht(e){return e===Se||e===Xt}function Hn(e){return e===Yt||e===Ke||e===eo||e===mt}function hc(e){return Hn(e.app)||e.trigger===!0}const ia={in:1,out:Number.POSITIVE_INFINITY};function la(e){return e==="many"?Number.POSITIVE_INFINITY:typeof e=="number"?e:void 0}function mc(...e){let t,s;for(const o of e)t??(t=la(o==null?void 0:o.in)),s??(s=la(o==null?void 0:o.out));return{in:t??ia.in,out:s??ia.out}}function hn(e,t){var r;if(e.uses.app===nt)return{in:1,out:so(e).length};const{app:s,action:o}=e.uses,a=e.uses.trigger?{in:0,out:1}:void 0;return mc(e.ports,t==null?void 0:t(s,o),((r=Pt(s,o))==null?void 0:r.ports)??a)}const wc='<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />',ca='<line x1="6" y1="3" x2="6" y2="15" /><circle cx="18" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><path d="M18 9a9 9 0 0 1-9 9" />',bc='<polyline points="17 1 21 5 17 9" /><path d="M3 11V9a4 4 0 0 1 4-4h14" /><polyline points="7 23 3 19 7 15" /><path d="M21 13v2a4 4 0 0 1-4 4H3" />',ua='<polyline points="23 4 23 10 17 10" /><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />',da='<rect x="3" y="5" width="12" height="16" rx="1" /><path d="M7 3h11a1 1 0 0 1 1 1v13" /><polyline points="16 13 19 16 22 13" />',yc='<line x1="6" y1="4" x2="6" y2="20" /><line x1="12" y1="4" x2="12" y2="20" /><line x1="18" y1="4" x2="18" y2="20" />',gc='<circle cx="12" cy="12" r="9" /><polyline points="12 7 12 12 15 14" />',xc='<rect x="3" y="4" width="18" height="18" rx="2" /><line x1="16" y1="2" x2="16" y2="6" /><line x1="8" y1="2" x2="8" y2="6" /><line x1="3" y1="10" x2="21" y2="10" /><polyline points="12 13 12 16 14 17" />',vc='<polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" />',pa='<ellipse cx="12" cy="5" rx="9" ry="3" /><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" /><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" />',kc='<circle cx="12" cy="12" r="10" /><line x1="2" y1="12" x2="22" y2="12" /><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />',jc='<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" /><line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />',Nc='<rect x="4" y="3" width="16" height="18" rx="2" /><line x1="8" y1="8" x2="16" y2="8" /><rect x="8" y="11" width="8" height="3" rx="1" /><line x1="8" y1="17.5" x2="12" y2="17.5" />',Sc='<polyline points="9 17 4 12 9 7" /><path d="M20 18v-2a4 4 0 0 0-4-4H4" />',fa='<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" />',Cc='<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /><polyline points="15 3 21 3 21 9" /><line x1="10" y1="14" x2="21" y2="3" />',Ac='<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" />',ys='<rect x="4" y="4" width="16" height="16" rx="2" /><rect x="9" y="9" width="6" height="6" /><line x1="9" y1="1" x2="9" y2="4" /><line x1="15" y1="1" x2="15" y2="4" /><line x1="9" y1="20" x2="9" y2="23" /><line x1="15" y1="20" x2="15" y2="23" /><line x1="20" y1="9" x2="23" y2="9" /><line x1="20" y1="14" x2="23" y2="14" /><line x1="1" y1="9" x2="4" y2="9" /><line x1="1" y1="14" x2="4" y2="14" />',Ec='<rect x="4" y="8" width="16" height="12" rx="2" /><line x1="12" y1="4" x2="12" y2="8" /><circle cx="12" cy="3" r="1" /><circle cx="9" cy="14" r="1.2" /><circle cx="15" cy="14" r="1.2" /><line x1="2" y1="13" x2="2" y2="16" /><line x1="22" y1="13" x2="22" y2="16" />',Tc='<path d="M8 3H7a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1" /><path d="M16 3h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-1" />',lt='<ellipse cx="12" cy="5" rx="9" ry="3" /><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" /><path d="M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3" />',Wt='<rect x="3" y="4" width="18" height="16" rx="2" /><line x1="3" y1="10" x2="21" y2="10" /><line x1="3" y1="15" x2="21" y2="15" /><line x1="9" y1="4" x2="9" y2="20" />',Oc='<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" /><polyline points="14 3 14 8 19 8" /><line x1="12" y1="11" x2="12" y2="17" /><polyline points="9.5 14.5 12 17 14.5 14.5" />',Rc=[{app:On,hidden:!0,action:"match",label:"Extract",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"Enter a regular expression without enclosing / delimiters. The extracted value is the first capture group, or the full match if there are no capture groups."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"value",label:"Extracted value"},{key:"matched",label:"Matched"},{key:"matches",label:"Matches"}]},{app:On,hidden:!0,action:"test",label:"Test",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"matched",label:"Matched"}]},{app:On,hidden:!0,action:"replace",label:"Replace",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."},{key:"replacement",label:"Replacement",type:"string",config:{multiline:!0},default:"",hint:"Replacement text; supports $1, $<name>, $&, $$, $` and $'. Leave empty to remove matches."}],output:[{key:"result",label:"Result"}]},{app:On,hidden:!0,action:"split",label:"Split",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"parts",label:"Parts"}]}],Ic=[{app:qt,action:"from-json",label:"From JSON",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"items",label:"Items",type:"json",required:!0,hint:"A list of objects, one per row."},{key:"csv",label:"Table",type:"json",hint:"Optional table to append to. Its columns stay first.",required:!1},{key:"columns",label:"Columns",type:"json",hint:"Optional column names, in order. Keys not listed are dropped."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"create",label:"Create table",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"columns",label:"Columns",type:"json",hint:"Column names, in order. Leave empty to use the keys of the rows."},{key:"rows",label:"Rows",type:"json",hint:"Optional list of row objects."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"add-rows",label:"Add rows",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"rows",label:"Rows",type:"json",required:!0,hint:"A list of row objects to append."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"remove-rows",label:"Remove rows",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"indexes",label:"Row positions",type:"json",hint:"Zero-based positions to remove. Use this or Match, not both."},{key:"where",label:"Match",type:"json",hint:'An object such as { "status": "done" }. A row is removed when every listed column equals its value exactly ("1" is not 1).'}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"to-text",label:"To CSV text",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"delimiter",label:"Delimiter",type:"string",default:",",hint:"One of , ; | or a tab."},{key:"header",label:"Header row",type:"boolean",default:!0,hint:"Write the column names as the first line."},{key:"bom",label:"Byte order mark",type:"boolean",default:!1,hint:"Start the text with U+FEFF, which some spreadsheet apps need for UTF-8."},{key:"escapeFormulas",label:"Escape formulas",type:"boolean",default:!1,hint:"Prefix text starting with = + - @ tab or CR with an apostrophe so spreadsheets do not run it. This breaks an exact round trip."},{key:"file",label:"Also create a file",type:"boolean",default:!1,hint:"Create a downloadable text/csv file as well as the text."},{key:"filename",label:"File name",type:"string",default:"data.csv",hint:"Used when a file is created. 1 to 255 characters, no slashes."}],output:[{key:"text",label:"Text"},{key:"file",label:"File"}]},{app:qt,action:"parse",label:"Parse CSV",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"text",label:"Text",type:"text",hint:"CSV text. Use this or File."},{key:"file",label:"File",type:"file",hint:"A CSV file from an earlier step. Use this or Text."},{key:"delimiter",label:"Delimiter",type:"string",default:",",hint:"One of , ; | or a tab."},{key:"header",label:"Header row",type:"boolean",default:!0,hint:"Off names the columns column_1, column_2 and so on."},{key:"inferTypes",label:"Detect types",type:"boolean",default:!0,hint:"Off keeps every cell as text."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]}],$c='<rect x="3" y="4" width="18" height="17" rx="2" /><line x1="3" y1="9" x2="21" y2="9" /><line x1="8" y1="2.5" x2="8" y2="6" /><line x1="16" y1="2.5" x2="16" y2="6" /><polyline points="12 12 12 15.5 14.5 17" />',Pc='<rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /><line x1="12" y1="15" x2="12" y2="17" />',_c='<line x1="9" y1="6" x2="20" y2="6" /><line x1="9" y1="12" x2="20" y2="12" /><line x1="9" y1="18" x2="20" y2="18" /><circle cx="4.5" cy="6" r="1" /><circle cx="4.5" cy="12" r="1" /><circle cx="4.5" cy="18" r="1" />',kr="An ISO 8601 date or date-time (with or without an offset), an RFC 2822 / HTTP date, or an epoch number: below 100,000,000,000 it is seconds, otherwise milliseconds. A date without an offset is read in the time zone.",ha="yyyy yy (year), MMMM MMM MM M (month), dd d (day), EEEE EEE (weekday), HH H (hour 0-23), hh h (hour 1-12), mm m (minute), ss s (second), SSS (milliseconds), a (AM/PM), XXX (offset, Z for UTC), xxx (+02:00), xx (+0200), VV (zone name), Q (quarter), ww w (ISO week). Put literal letters in single quotes, e.g. yyyy-MM-dd'T'HH:mm.",Et=e=>({key:"timezone",label:"Time zone",type:"string",default:"",hint:`${e} An IANA name such as Europe/Berlin or America/New_York. Leave empty for UTC.`}),Tt=(e="date",t="Date")=>({key:e,label:t,type:"string",default:"",hint:kr}),jr=[{value:"years",label:"Years"},{value:"quarters",label:"Quarters"},{value:"months",label:"Months"},{value:"weeks",label:"Weeks"},{value:"days",label:"Days"},{value:"hours",label:"Hours"},{value:"minutes",label:"Minutes"},{value:"seconds",label:"Seconds"},{value:"milliseconds",label:"Milliseconds"}],Ot=[{key:"iso",label:"ISO 8601"},{key:"epochMs",label:"Epoch milliseconds"},{key:"timezone",label:"Time zone"},{key:"offset",label:"UTC offset"}],ut=(e,t,s,o)=>({app:rc,action:e,label:t,displayName:"Date & Time",groupActions:!0,group:"compute",icon:$c,params:s,output:o}),ma=e=>ut(e,e==="add"?"Add":"Subtract",[Tt(),{key:"amount",label:"Amount",type:"number",default:1,hint:`How much to ${e}. Whole number for years to days; hours and smaller may have decimals.`},{key:"unit",label:"Unit",type:"select",default:"days",options:jr,hint:"Days and larger follow the calendar in the time zone (the clock time is kept across daylight saving); hours and smaller are exact elapsed time."},Et("Where calendar math happens.")],Ot),Fc=[ut("now","Now",[Et("The zone to show the time in."),{key:"format",label:"Format",type:"string",default:"",hint:"Optional. A preset (iso, date, time, datetime, rfc2822, http, epoch, epoch_ms) or a pattern. When set, the output also has a formatted value."}],[...Ot,{key:"formatted",label:"Formatted"}]),ut("format","Format",[Tt(),{key:"format",label:"Format",type:"string",default:"iso",hint:`A preset: iso, date (yyyy-MM-dd), time (HH:mm:ss), datetime, rfc2822, http (GMT), epoch (seconds), epoch_ms. Or a pattern using: ${ha}`},Et("The zone the date is shown in."),{key:"locale",label:"Locale",type:"string",default:"",hint:"Language for month and weekday names, e.g. de-DE. Leave empty for en-US."}],[...Ot,{key:"formatted",label:"Formatted"}]),ut("parse","Parse",[{key:"text",label:"Text",type:"string",default:"",hint:"The text to read. With no format it is detected: ISO 8601, epoch seconds or milliseconds, or an RFC 2822 / HTTP date."},{key:"format",label:"Format",type:"string",default:"",hint:`Optional pattern the text follows, using: ${ha} Missing parts default to 1970-01-01 00:00:00. Q, w and ww are not available for parsing.`},Et("The zone for text that carries no offset."),{key:"locale",label:"Locale",type:"string",default:"",hint:"Language of month and weekday names in the text. Leave empty for en-US."}],Ot),ma("add"),ma("subtract"),ut("difference","Difference",[Tt("start","Start"),Tt("end","End"),{key:"unit",label:"Unit",type:"select",default:"days",options:jr,hint:"Years, quarters and months are calendar-aware; weeks and smaller are elapsed time. Only complete units count."},Et("Where calendar math happens.")],[{key:"value",label:"Difference"},{key:"unit",label:"Unit"},{key:"start",label:"Start (ISO 8601)"},{key:"end",label:"End (ISO 8601)"},{key:"timezone",label:"Time zone"}]),ut("extract","Extract part",[Tt(),{key:"part",label:"Part",type:"select",default:"year",options:[{value:"year",label:"Year"},{value:"quarter",label:"Quarter"},{value:"month",label:"Month"},{value:"week",label:"Week (ISO)"},{value:"day",label:"Day of month"},{value:"dayOfWeek",label:"Day of week (1 = Monday)"},{value:"dayOfYear",label:"Day of year"},{value:"hour",label:"Hour"},{value:"minute",label:"Minute"},{value:"second",label:"Second"},{value:"millisecond",label:"Millisecond"}],hint:"Which part to read, in the time zone."},Et("The zone the part is read in.")],[{key:"value",label:"Value"},{key:"part",label:"Part"},...Ot]),ut("round","Round",[Tt(),{key:"unit",label:"Unit",type:"select",default:"day",options:[{value:"year",label:"Year"},{value:"quarter",label:"Quarter"},{value:"month",label:"Month"},{value:"week",label:"Week (starts Monday)"},{value:"day",label:"Day"},{value:"hour",label:"Hour"},{value:"minute",label:"Minute"},{value:"second",label:"Second"}],hint:"The boundary to round to, in the time zone."},{key:"direction",label:"Direction",type:"select",default:"down",options:[{value:"down",label:"Down (start of the unit)"},{value:"up",label:"Up (next boundary)"},{value:"nearest",label:"Nearest"}],hint:"Up leaves a date that is already on a boundary unchanged; nearest rounds halfway up."},Et("Where the boundaries are.")],[...Ot,{key:"unit",label:"Unit"},{key:"direction",label:"Direction"}]),ut("convert","Convert time zone",[{...Tt(),hint:kr.replace("in the time zone","as UTC")},{key:"timezone",label:"Time zone",type:"string",default:"",hint:"The zone to show it in: an IANA name such as Asia/Tokyo, or UTC."}],Ot)],gs=e=>({key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:e}),xs={key:"algorithm",label:"Algorithm",type:"select",default:"sha256",options:[{value:"sha256",label:"SHA-256"},{value:"sha1",label:"SHA-1"},{value:"sha384",label:"SHA-384"},{value:"sha512",label:"SHA-512"}],hint:"Hash function. SHA-256 is the usual choice; SHA-1 is only for vendors that still require it."},vs=e=>({key:"encoding",label:"Encoding",type:"select",default:"hex",options:[{value:"hex",label:"Hex"},{value:"base64",label:"Base64"},{value:"base64url",label:"Base64 URL-safe"}],hint:e}),wa=[{key:"key",label:"Key",type:"string",default:"",hint:"The shared secret. Use a vault secret, e.g. {{ secrets.webhook_signing_key }}. It is never returned in the output."},{key:"keyEncoding",label:"Key encoding",type:"select",default:"utf8",options:[{value:"utf8",label:"Plain text"},{value:"hex",label:"Hex"},{value:"base64",label:"Base64"}],hint:"How the key is written. Most vendors give a plain-text key; some give hex or Base64."}],on=(e,t,s,o)=>({app:ic,action:e,label:t,displayName:"Crypto",groupActions:!0,group:"compute",icon:Pc,params:s,output:o}),Lc=[on("hash","Hash",[gs("Text to hash, up to 10 MB. Empty text is allowed."),xs,vs("How the digest is written.")],[{key:"digest",label:"Digest"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("hmac","HMAC",[gs("The message to sign, up to 10 MB."),...wa,xs,vs("How the signature is written.")],[{key:"digest",label:"Signature"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("verify-hmac","Verify HMAC",[gs("The signed message, usually the raw request body."),...wa,xs,vs("How the expected signature is written."),{key:"signature",label:"Signature",type:"string",default:"",hint:"The signature to check, in the encoding above (e.g. from the request's signature header). The comparison is constant-time."}],[{key:"valid",label:"Valid"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("uuid","UUID",[{key:"count",label:"Count",type:"number",default:1,hint:"How many UUIDs, from 1 to 1000."}],[{key:"uuid",label:"UUID"},{key:"uuids",label:"UUIDs"}]),on("random","Random",[{key:"length",label:"Length",type:"number",default:32,hint:"Number of random bytes (1 to 4096). For Alphanumeric it is the number of characters instead."},{key:"encoding",label:"Encoding",type:"select",default:"hex",options:[{value:"hex",label:"Hex"},{value:"base64",label:"Base64"},{value:"base64url",label:"Base64 URL-safe"},{value:"alphanumeric",label:"Letters and digits"}],hint:"How the random value is written."}],[{key:"value",label:"Value"},{key:"encoding",label:"Encoding"},{key:"length",label:"Length"}])],At={key:"items",label:"Items",type:"json",required:!0,hint:"The list to work on. Bind the array itself, e.g. {{ steps.fetch.output.body.data }}, not the whole response."},an={key:"items",label:"Items"},Mc="A dot path into each item, such as user.email or tags.0. Leave empty to use the item itself.",ct=(e,t,s,o)=>({app:lc,action:e,label:t,displayName:"List",groupActions:!0,group:"compute",icon:_c,params:s,output:o}),Dc=[ct("filter","Filter",[At,{key:"conditions",label:"Conditions",type:"json",required:!0,hint:'A list such as [{ "field": "status", "operator": "equals", "value": "paid" }]. Operators: equals, not_equals, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, matches (regular expression, up to 500 characters), in, not_in (value is a list), exists, not_exists, is_empty, is_not_empty, is_true, is_false. Numbers and ISO dates compare by value; other text compares as plain text.'},{key:"combine",label:"Combine conditions",type:"select",default:"and",options:[{value:"and",label:"All must match"},{value:"or",label:"Any can match"}]},{key:"caseSensitive",label:"Case sensitive",type:"boolean",default:!0,hint:"Turn off to ignore upper and lower case in text comparisons."}],[an,{key:"kept",label:"Kept"},{key:"removed",label:"Removed"}]),ct("sort","Sort",[At,{key:"by",label:"Sort by",type:"json",required:!0,hint:'A list such as [{ "field": "createdAt", "direction": "desc" }]. Direction is asc (default) or desc. Later entries break ties.'}],[an]),ct("limit","Limit",[At,{key:"count",label:"Count",type:"number",required:!0,hint:"How many to keep."},{key:"from",label:"Keep from",type:"select",default:"start",options:[{value:"start",label:"Start of the list"},{value:"end",label:"End of the list"}]},{key:"offset",label:"Skip",type:"number",default:0,hint:"How many items to skip from that end first."}],[an]),ct("pluck","Extract field",[At,{key:"field",label:"Field",type:"string",hint:Mc},{key:"unique",label:"Only distinct values",type:"boolean",default:!1},{key:"skipEmpty",label:"Skip empty values",type:"boolean",default:!1,hint:"Leave out missing, null and empty-text values."}],[{key:"values",label:"Values"}]),ct("unique","Remove duplicates",[At,{key:"fields",label:"Compare fields",type:"json",hint:'A list of field paths such as ["email"]. Leave empty to compare the whole item exactly.'},{key:"keep",label:"Keep",type:"select",default:"first",options:[{value:"first",label:"First occurrence"},{value:"last",label:"Last occurrence"}]}],[an,{key:"removed",label:"Removed items"}]),ct("chunk","Split into batches",[At,{key:"size",label:"Batch size",type:"number",required:!0,default:10}],[{key:"chunks",label:"Batches"},{key:"count",label:"Number of batches"}]),ct("join","Merge lists",[{key:"left",label:"First list",type:"json",required:!0,hint:"Bind the array itself, not the whole response."},{key:"right",label:"Second list",type:"json",required:!0,hint:"Bind the array itself, not the whole response."},{key:"mode",label:"Combine by",type:"select",default:"field",options:[{value:"field",label:"Matching field"},{value:"position",label:"Position"},{value:"all",label:"Every pair"}]},{key:"leftField",label:"Field in first list",type:"string",hint:"Needed when combining by matching field. Text and numbers match by value."},{key:"rightField",label:"Field in second list",type:"string",hint:"Leave empty to use the same field as the first list."},{key:"type",label:"Keep",type:"select",default:"inner",options:[{value:"inner",label:"Only matches"},{value:"left",label:"All of the first list"},{value:"right",label:"All of the second list"},{value:"full",label:"Everything from both"}]},{key:"multipleMatches",label:"When several match",type:"select",default:"all",options:[{value:"all",label:"Keep every match"},{value:"first",label:"Keep the first match"}]},{key:"clash",label:"When fields share a name",type:"select",default:"right",options:[{value:"right",label:"Second list wins"},{value:"left",label:"First list wins"},{value:"prefix",label:"Keep both (prefix second with right_)"}]}],[an]),ct("summarize","Summarize",[At,{key:"groupBy",label:"Group by",type:"json",hint:'A list of field paths such as ["country"]. Leave empty for one overall result.'},{key:"aggregations",label:"Calculations",type:"json",required:!0,hint:'A list such as [{ "field": "amount", "op": "sum", "as": "total" }]. Ops: count, count_unique, sum, avg, min, max, first, last, append, concat (add "separator", default ", "). Without "as" the result is named like sum_amount.'}],[{key:"groups",label:"Groups"}])],qc='<path d="M4 7V5h11v2M9.5 5v14M7.5 19h4" /><path d="M15 13h6M15 17h4" />',We=(e,t,s,o,a)=>({app:sc,action:e,label:t,displayName:"Text",groupActions:!0,group:"compute",icon:qc,keywords:s,params:o,output:a}),Wc=[We("check","Check text",["regex","regular expression","regexp","contains","includes","starts with","ends with","equals","test","match","if"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"mode",label:"Check that the text",type:"select",default:"contains",options:[{value:"contains",label:"Contains"},{value:"starts-with",label:"Starts with"},{value:"ends-with",label:"Ends with"},{value:"equals",label:"Is exactly"},{value:"pattern",label:"Matches a pattern (regex)"}]},{key:"value",label:"Value",type:"string",default:"",hint:"The text to look for. For a pattern, a regular expression without / delimiters, such as ^INV-\\d+$."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"mode",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."}],[{key:"matched",label:"Matched"}]),We("extract","Extract values",["regex","regular expression","regexp","parse","find","scrape","email","url","link","phone","number","hashtag","mention","capture group"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"what",label:"Extract",type:"select",default:"email",options:[{value:"email",label:"Email addresses"},{value:"url",label:"Links (URLs)"},{value:"phone",label:"Phone numbers"},{value:"number",label:"Numbers"},{value:"hashtag",label:"#Hashtags"},{value:"mention",label:"@Mentions"},{value:"pattern",label:"A pattern (regex)"}]},{key:"pattern",label:"Pattern",type:"string",default:"",showIf:{field:"what",equals:"pattern"},hint:"A regular expression without / delimiters. Each value is its first capture group, or the whole match when it has none."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"what",equals:"pattern"},hint:"Optional: i (ignore case), m (^ and $ match at each line), s (. matches newlines), u (Unicode)."},{key:"all",label:"Every match",type:"boolean",default:!0,hint:"Turn off to return only the first match."},{key:"unique",label:"Drop repeats",type:"boolean",default:!1,hint:"Return each value once."}],[{key:"value",label:"First value"},{key:"values",label:"Values"},{key:"matched",label:"Found any"},{key:"count",label:"Count"},{key:"matches",label:"Matches"}]),We("replace","Find and replace",["regex","regular expression","regexp","substitute","find and replace","remove","sed","gsub"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"mode",label:"Find",type:"select",default:"text",options:[{value:"text",label:"Plain text"},{value:"pattern",label:"A pattern (regex)"}]},{key:"find",label:"Find what",type:"string",default:"",hint:"The text to find. For a pattern, a regular expression without / delimiters."},{key:"replacement",label:"Replace with",type:"string",config:{multiline:!0},default:"",hint:"The new text. For a pattern, $1, $<name> and $& insert what was matched. Leave empty to remove matches."},{key:"all",label:"Every match",type:"boolean",default:!0,hint:"Turn off to replace only the first match."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"mode",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."}],[{key:"result",label:"Result"}]),We("split","Split text",["regex","regular expression","regexp","explode","tokenize","separate","delimiter","lines","words","characters"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"by",label:"Split by",type:"select",default:"separator",options:[{value:"separator",label:"A separator"},{value:"pattern",label:"A pattern (regex)"},{value:"lines",label:"Lines"},{value:"words",label:"Words"},{value:"characters",label:"Characters"}]},{key:"separator",label:"Separator",type:"string",default:",",showIf:{field:"by",equals:"separator"},hint:"The text between parts, such as , or ; or |. Empty splits into characters."},{key:"pattern",label:"Pattern",type:"string",default:"",showIf:{field:"by",equals:"pattern"},hint:"A regular expression without / delimiters. Captured groups are kept as parts."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"by",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."},{key:"trim",label:"Trim parts",type:"boolean",default:!0,hint:"Remove spaces around each part."},{key:"removeEmpty",label:"Drop empty parts",type:"boolean",default:!1}],[{key:"parts",label:"Parts"},{key:"count",label:"Count"}]),We("similarity","Similarity",["fuzzy","fuzzy match","compare","similar","distance","edit distance","levenshtein","jaro","winkler","dice","jaccard","soundex","phonetic","sounds like","typo","ratio","difflib","rapidfuzz","damerau","transposition","token set","token sort","sorensen","sørensen","bigram","ratcliff","obershelp","gestalt","lcs","longest common subsequence"],[{key:"a",label:"First text",type:"string",config:{multiline:!0},default:""},{key:"b",label:"Second text",type:"string",config:{multiline:!0},default:""},{key:"method",label:"How to compare",type:"select",default:"auto",options:[{value:"auto",label:"Best overall (a blend of three)"},{value:"jaro-winkler",label:"Typos and names (Jaro–Winkler)"},{value:"levenshtein",label:"Character edits (Levenshtein)"},{value:"damerau",label:"Edits and swapped letters (Damerau–Levenshtein)"},{value:"token-set",label:"Same words, extra words allowed (token set)"},{value:"token-sort",label:"Same words, any order (token sort)"},{value:"dice",label:"Letter pairs (Sørensen–Dice)"},{value:"jaccard",label:"Shared words (Jaccard)"},{value:"ratcliff",label:"Common runs of text (Ratcliff–Obershelp)"},{value:"lcs",label:"Letters in order (longest common subsequence)"},{value:"soundex",label:"Sounds alike (Soundex)"}],hint:"Best overall averages Jaro–Winkler, token set and letter pairs, and shows each score in Breakdown."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!0,hint:"Treat upper and lower case as the same."},{key:"ignoreAccents",label:"Ignore accents",type:"boolean",default:!0,hint:"Treat é as e and ü as u."},{key:"ignorePunctuation",label:"Ignore punctuation",type:"boolean",default:!0,hint:"Treat punctuation and symbols as spaces: “Acme, Inc.” matches “Acme Inc”."},{key:"ignoreStopWords",label:"Ignore connecting words",type:"boolean",default:!1,hint:"Skip stop words such as the, a, of and and, so “The Bank of America” matches “Bank America”."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"ignoreStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"score",label:"Score"},{key:"method",label:"Method"},{key:"distance",label:"Edits"},{key:"breakdown",label:"Breakdown"},{key:"keys",label:"Sound codes"},{key:"normalized",label:"Compared as"}]),We("best-match","Best match",["fuzzy","fuzzy lookup","closest","nearest","lookup","vlookup","did you mean","autocorrect","levenshtein","jaro","rank"],[{key:"text",label:"Text to match",type:"string",default:"",hint:"The text to look up, such as a company name from a form."},{key:"candidates",label:"List to search",type:"json",required:!0,hint:"Texts, or objects with Field set. Bind the array itself, e.g. {{ steps.accounts.output.body.data }}."},{key:"field",label:"Field",type:"string",hint:"For a list of objects, the dot path of the text to compare, such as name or company.name."},{key:"method",label:"How to compare",type:"select",default:"auto",options:[{value:"auto",label:"Best overall (a blend of three)"},{value:"jaro-winkler",label:"Typos and names (Jaro–Winkler)"},{value:"levenshtein",label:"Character edits (Levenshtein)"},{value:"damerau",label:"Edits and swapped letters (Damerau–Levenshtein)"},{value:"token-set",label:"Same words, extra words allowed (token set)"},{value:"token-sort",label:"Same words, any order (token sort)"},{value:"dice",label:"Letter pairs (Sørensen–Dice)"},{value:"jaccard",label:"Shared words (Jaccard)"},{value:"ratcliff",label:"Common runs of text (Ratcliff–Obershelp)"},{value:"lcs",label:"Letters in order (longest common subsequence)"},{value:"soundex",label:"Sounds alike (Soundex)"}],hint:"Best overall averages Jaro–Winkler, token set and letter pairs, and shows each score in Breakdown."},{key:"threshold",label:"Minimum score",type:"number",default:0,hint:"From 0 to 1. When the best score is lower, Match is empty and Matched is false."},{key:"limit",label:"Ranked entries",type:"number",default:5,hint:"How many of the closest entries Ranked lists (1–100)."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!0,hint:"Treat upper and lower case as the same."},{key:"ignoreAccents",label:"Ignore accents",type:"boolean",default:!0,hint:"Treat é as e and ü as u."},{key:"ignorePunctuation",label:"Ignore punctuation",type:"boolean",default:!0,hint:"Treat punctuation and symbols as spaces: “Acme, Inc.” matches “Acme Inc”."},{key:"ignoreStopWords",label:"Ignore connecting words",type:"boolean",default:!1,hint:"Skip stop words such as the, a, of and and, so “The Bank of America” matches “Bank America”."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"ignoreStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"match",label:"Match"},{key:"score",label:"Score"},{key:"index",label:"Position"},{key:"matched",label:"Matched"},{key:"method",label:"Method"},{key:"ranked",label:"Ranked"}]),We("diff","Find differences",["diff","changes","compare","delta","patch","unified diff","what changed","version"],[{key:"a",label:"Original",type:"string",config:{multiline:!0},default:""},{key:"b",label:"Changed",type:"string",config:{multiline:!0},default:""},{key:"by",label:"Compare by",type:"select",default:"lines",options:[{value:"lines",label:"Lines"},{value:"words",label:"Words"}]},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"ignoreWhitespace",label:"Ignore spacing",type:"boolean",default:!1,hint:"Treat runs of spaces as one and ignore spaces at the ends of lines."}],[{key:"changed",label:"Changed"},{key:"added",label:"Added"},{key:"removed",label:"Removed"},{key:"unchanged",label:"Unchanged"},{key:"changes",label:"Changes"},{key:"unified",label:"Unified diff"}]),We("change-case","Change case",["case","uppercase","lowercase","capitalize","title case","camel case","pascal case","snake case","kebab case","slug","slugify","permalink"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"to",label:"Change to",type:"select",default:"lower",options:[{value:"lower",label:"lower case"},{value:"upper",label:"UPPER CASE"},{value:"title",label:"Title Case"},{value:"sentence",label:"Sentence case"},{value:"camel",label:"camelCase"},{value:"pascal",label:"PascalCase"},{value:"snake",label:"snake_case"},{value:"kebab",label:"kebab-case"},{value:"constant",label:"CONSTANT_CASE"},{value:"slug",label:"url-slug"}]}],[{key:"result",label:"Result"}]),We("normalize","Clean up",["normalize","clean","sanitize","trim","strip","accents","diacritics","punctuation","whitespace","stop words","canonical"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"lowercase",label:"Lower case",type:"boolean",default:!0},{key:"removeAccents",label:"Remove accents",type:"boolean",default:!0,hint:"é becomes e, ü becomes u."},{key:"removePunctuation",label:"Remove punctuation",type:"boolean",default:!1,hint:"Replace punctuation and symbols with spaces."},{key:"collapseWhitespace",label:"Tidy spaces",type:"boolean",default:!0,hint:"Trim the ends and turn runs of spaces, tabs and newlines into one space."},{key:"removeStopWords",label:"Remove connecting words",type:"boolean",default:!1,hint:"Drop stop words such as the, a, of and and."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"removeStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"result",label:"Result"}]),We("truncate","Shorten",["truncate","shorten","limit","excerpt","ellipsis","max length","sms","preview"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"length",label:"Length",type:"number",default:100,hint:"The longest result in characters, ending included — or, by words, how many words to keep."},{key:"unit",label:"Count",type:"select",default:"characters",options:[{value:"characters",label:"Characters"},{value:"words",label:"Words"}]},{key:"ending",label:"Ending",type:"string",default:"…",hint:"Added only when the text is cut. Leave empty for none."},{key:"keepWholeWords",label:"Keep whole words",type:"boolean",default:!0,showIf:{field:"unit",equals:"characters"},hint:"Cut after the last whole word that fits."}],[{key:"result",label:"Result"},{key:"truncated",label:"Was shortened"}]),We("mask","Mask sensitive data",["mask","redact","anonymize","pii","gdpr","hide","obfuscate","credit card","luhn","privacy"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"emails",label:"Email addresses",type:"boolean",default:!0,hint:"Keeps the first letter and the domain: j***@acme.io."},{key:"phones",label:"Phone numbers",type:"boolean",default:!0},{key:"cardNumbers",label:"Card numbers",type:"boolean",default:!0,hint:"Only numbers that pass the card checksum (Luhn)."},{key:"pattern",label:"Also mask (regex)",type:"string",default:"",hint:"Optional regular expression for anything else to hide, such as an order reference."},{key:"keepLast",label:"Keep last",type:"number",default:4,hint:"Letters and digits left visible at the end of each phone, card or pattern match — never more than half of them."},{key:"maskWith",label:"Mask character",type:"string",default:"*"}],[{key:"result",label:"Result"},{key:"count",label:"Masked"}]),We("count","Count",["count","length","word count","character count","chars","bytes","size","lines"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."}],[{key:"characters",label:"Characters"},{key:"words",label:"Words"},{key:"sentences",label:"Sentences"},{key:"lines",label:"Lines"},{key:"paragraphs",label:"Paragraphs"},{key:"bytes",label:"Bytes"}])],Uc='<path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" />',He=(e,t,s,o,a)=>({app:oc,action:e,label:t,displayName:"Number",groupActions:!0,group:"compute",icon:Uc,keywords:s,params:o,output:a}),Bc=[He("calculate","Calculate",["calculate","calculator","math","arithmetic","add","plus","sum","subtract","minus","multiply","times","divide","division","remainder","modulo","mod","power","exponent","min","max","average","mean"],[{key:"a",label:"First number",type:"number",required:!0},{key:"operation",label:"Operation",type:"select",default:"add",options:[{value:"add",label:"Add (+)"},{value:"subtract",label:"Subtract (−)"},{value:"multiply",label:"Multiply (×)"},{value:"divide",label:"Divide (÷)"},{value:"remainder",label:"Remainder (modulo)"},{value:"power",label:"Power (^)"},{value:"min",label:"Smaller of the two (min)"},{value:"max",label:"Larger of the two (max)"},{value:"average",label:"Average of the two"}]},{key:"b",label:"Second number",type:"number",required:!0}],[{key:"result",label:"Result"}]),He("increment","Increment",["counter","increment","decrement","++","--","step","page number","count up","count down","index","loop","wrap around","round robin"],[{key:"value",label:"Number",type:"number",default:0,hint:"The current value, such as {{ steps.page.output.result }}. Counts within this run only: for a counter that persists across runs, use Store → Increment counter."},{key:"by",label:"Step",type:"number",default:1,hint:"Added to the number. Use a negative step to count down."},{key:"min",label:"Minimum",type:"number",hint:"Optional lowest allowed value."},{key:"max",label:"Maximum",type:"number",hint:"Optional highest allowed value."},{key:"atLimit",label:"Past the limit",type:"select",default:"clamp",options:[{value:"clamp",label:"Stop at the limit"},{value:"wrap",label:"Wrap around"},{value:"refuse",label:"Fail the step"}],hint:"What happens when the step would pass Minimum or Maximum. Used only when one of them is set; Wrap around needs both."}],[{key:"result",label:"Result"},{key:"previous",label:"Previous"},{key:"hitLimit",label:"Hit the limit"}]),He("formula","Formula",["formula","expression","equation","evaluate","eval","calculate","math","arithmetic","variables","excel formula","spreadsheet","sqrt","abs"],[{key:"formula",label:"Formula",type:"string",required:!0,placeholder:"(price * qty) * (1 - discount)",hint:"+ - * / % (remainder) and ^ (power), parentheses, and min, max, abs, round, floor, ceil, sqrt. Names come from Variables."},{key:"variables",label:"Variables",type:"json",hint:'The names the formula uses and their numbers, such as { "price": 19.99, "qty": 3, "discount": 0.1 }.'}],[{key:"result",label:"Result"}]),He("clamp","Keep in range",["clamp","range","limit","bound","bounds","between","constrain","min","max","cap","floor"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"min",label:"Minimum",type:"number",required:!0},{key:"max",label:"Maximum",type:"number",required:!0}],[{key:"result",label:"Result"},{key:"clamped",label:"Was changed"}]),He("round","Round number",["round","rounding","decimal places","decimals","precision","floor","ceil","ceiling","truncate","trunc","half even","banker's rounding","nearest","tofixed","step"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"mode",label:"Round",type:"select",default:"round",options:[{value:"round",label:"Nearest"},{value:"half-even",label:"Nearest, ties to even (banker's)"},{value:"floor",label:"Down (floor)"},{value:"ceil",label:"Up (ceiling)"},{value:"truncate",label:"Toward zero (truncate)"}],hint:"Nearest rounds a tie away from zero: 2.5 becomes 3 and −2.5 becomes −3."},{key:"to",label:"Round to",type:"select",default:"decimals",options:[{value:"decimals",label:"Decimal places"},{value:"step",label:"A step, such as 0.05"}]},{key:"decimals",label:"Decimal places",type:"number",default:2,showIf:{field:"to",equals:"decimals"},hint:"From 0 to 15."},{key:"step",label:"Step",type:"number",default:.05,showIf:{field:"to",equals:"step"},hint:"Round to a multiple of this, such as 0.05 (nickels), 0.25 or 5."}],[{key:"result",label:"Result"}]),He("format","Format number",["format","currency","money","price","percent","percentage","compact","thousands separator","locale","intl","numberformat","tolocalestring","unit","pretty"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"style",label:"Style",type:"select",default:"decimal",options:[{value:"decimal",label:"Number (1,234.5)"},{value:"currency",label:"Currency ($1,234.50)"},{value:"percent",label:"Percent (0.12 → 12%)"},{value:"compact",label:"Compact (1.2K)"},{value:"unit",label:"With a unit (12 km)"}]},{key:"locale",label:"Locale",type:"string",default:"en-US",hint:"A language tag that decides separators and symbols, such as en-US, de-DE or fr-FR."},{key:"currency",label:"Currency",type:"string",default:"USD",showIf:{field:"style",equals:"currency"},hint:"A three-letter ISO 4217 code, such as USD, EUR or JPY."},{key:"unit",label:"Unit",type:"string",default:"",showIf:{field:"style",equals:"unit"},hint:"A unit such as kilometer, kilogram, liter, megabyte, percent or kilometer-per-hour."},{key:"minDecimals",label:"Fewest decimals",type:"number",hint:"Optional, from 0 to 20. Pads with zeros: 2 shows 5 as 5.00."},{key:"maxDecimals",label:"Most decimals",type:"number",hint:"Optional, from 0 to 20. Rounds to this many."},{key:"prefix",label:"Before",type:"string",default:"",hint:"Optional text placed before the number."},{key:"suffix",label:"After",type:"string",default:"",hint:'Optional text placed after the number, such as " per month".'}],[{key:"result",label:"Result"}]),He("parse","Read a number from text",["parse","parsefloat","parseint","to number","string to number","convert","cast","extract number","currency","money","percent","locale","decimal separator"],[{key:"text",label:"Text",type:"string",default:"",hint:"The text to read, such as a price from a web page or a CSV cell."},{key:"locale",label:"Locale",type:"string",default:"en-US",hint:"Decides the decimal and thousands separators: en-US reads 1,234.56 and de-DE reads 1.234,56."},{key:"percentAsFraction",label:"Percent as a fraction",type:"boolean",default:!0,hint:"Read 12% as 0.12. Turn off to read it as 12."},{key:"allowSuffixes",label:"Read K, M, B and T",type:"boolean",default:!0,hint:"Read 1.2K as 1200, 3M as 3000000, 2B (or 2bn) as 2000000000 and 1T as a trillion."}],[{key:"result",label:"Result"},{key:"found",label:"Found"}]),He("percent-change","Percent change",["percent change","percentage change","growth","growth rate","delta","difference","increase","decrease","change","yoy","mom","trend"],[{key:"from",label:"From",type:"number",required:!0,hint:"The earlier or baseline number."},{key:"to",label:"To",type:"number",required:!0,hint:"The later number."}],[{key:"change",label:"Change"},{key:"percent",label:"Percent"},{key:"direction",label:"Direction"}]),He("allocate","Split an amount",["split","allocate","allocation","distribute","divide","share","pro rata","prorate","installments","largest remainder","cents","bill split","ratio"],[{key:"amount",label:"Amount",type:"number",required:!0},{key:"parts",label:"Equal parts",type:"number",hint:"How many equal parts, from 1 to 10,000. Leave empty to split by Ratios instead."},{key:"ratios",label:"Ratios",type:"json",hint:"Instead of equal parts, a list of shares such as [50, 30, 20] or [1, 2]."},{key:"decimals",label:"Decimal places",type:"number",default:2,hint:"The smallest unit, from 0 to 10: 2 splits into cents."}],[{key:"parts",label:"Parts"}]),He("describe","Statistics",["statistics","stats","describe","summary","mean","average","median","mode","standard deviation","stddev","variance","percentile","quantile","p95","p99","min","max","sum"],[{key:"values",label:"Numbers",type:"json",required:!0,hint:"A list of numbers, such as {{ steps.orders.output.totals }}. Entries that are not numbers are skipped and counted."},{key:"percentiles",label:"Percentiles",type:"json",default:[50,90,95,99],hint:"Which percentiles to return, from 0 to 100. Linear interpolation between values (the spreadsheet PERCENTILE.INC and NumPy default)."}],[{key:"count",label:"Count"},{key:"skipped",label:"Skipped"},{key:"sum",label:"Sum"},{key:"mean",label:"Mean"},{key:"median",label:"Median"},{key:"mode",label:"Mode"},{key:"min",label:"Min"},{key:"max",label:"Max"},{key:"range",label:"Range"},{key:"variance",label:"Variance"},{key:"sampleVariance",label:"Sample variance"},{key:"stddev",label:"Standard deviation"},{key:"sampleStddev",label:"Sample standard deviation"},{key:"percentiles",label:"Percentiles"}]),He("random","Random number",["random","random number","random integer","rand","rng","dice","roll","lottery","pick","uniform","sample"],[{key:"min",label:"Minimum",type:"number",default:0},{key:"max",label:"Maximum",type:"number",default:100},{key:"integer",label:"Whole number",type:"boolean",default:!0},{key:"decimals",label:"Decimal places",type:"number",default:2,showIf:{field:"integer",equals:!1},hint:"From 0 to 15."}],[{key:"result",label:"Result"}])],ba={key:"onMax",type:"select",label:"When the limit is reached",default:"fail",hint:"Fail the step, or stop looping and continue the workflow with what was collected.",options:[{value:"fail",label:"Fail the step"},{value:"stop",label:"Stop and continue the workflow"}]},wt=[...Wc,...Bc,...Rc,...Ic,...Fc,...Lc,...Dc,{app:Xt,action:"race",label:"Race",displayName:"Race",group:"control",icon:'<path d="M3 5h4l5 7h9M3 19h4l5-7" /><polyline points="17 8 21 12 17 16" />',ports:{in:"many",out:1},params:[]},{app:nt,action:"route",label:"Router",displayName:"Router",group:"control",icon:ca,params:[{key:"routes",label:"Routes",type:"json",required:!0,default:[{id:"route_1",label:"Route 1",condition:!1},{id:"default",label:"Default",default:!0}]}],output:[{key:"route",label:"Selected route"}]},{app:no,action:"stop",label:"Stop workflow",displayName:"Stop workflow",group:"control",icon:'<rect x="5" y="5" width="14" height="14" rx="2" />',params:[{key:"condition",label:"Condition",type:"json",default:!0,hint:"Stop when this condition is true. Omit it to always stop."},{key:"outcome",label:"Outcome",type:"select",default:"success",hint:"Success: end the run as succeeded. Error: fail this step with the message below, so error paths and the workflow error handler run.",options:[{value:"success",label:"Success"},{value:"error",label:"Error"}]},{key:"message",label:"Error message",type:"string",default:"Stopped by workflow",hint:"Shown as the step's error when the condition holds.",showIf:{field:"outcome",equals:"error"}}],output:[{key:"stopped",label:"Stopped"}]},{app:Yt,action:"manual",label:"Manual trigger",displayName:"Manual trigger",group:"trigger",icon:wc,ports:{in:0,out:1},params:[{key:"fields",label:"Fields",type:"array",default:[],hint:"The fields this trigger emits into the run. Reference them downstream as {{ nodes.<trigger>.output.<key> }}.",item:{type:"object",fields:[{key:"key",label:"Key",type:"string",placeholder:"e.g. email"},{key:"type",label:"Type",type:"select",default:"string",options:[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"boolean",label:"Boolean"},{value:"json",label:"JSON"}]},{key:"default",label:"Default",type:"string",placeholder:"optional",config:{valueTypeFrom:"type"}},{key:"required",label:"Required",type:"boolean",default:!1}]}}]},{app:Ke,action:"webhook",label:"Webhook",displayName:"Webhook",group:"trigger",icon:jc,ports:{in:0,out:1},params:[{key:"methods",label:"HTTP Methods",type:"multiselect",required:!0,default:["POST"],hint:"Which HTTP methods this webhook accepts.",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"PATCH",label:"PATCH"},{value:"DELETE",label:"DELETE"},{value:"HEAD",label:"HEAD"}]},{key:"auth",label:"Authentication",type:"select",default:"none",hint:"How incoming requests are authenticated.",options:[{value:"none",label:"None"},{value:"basic",label:"Basic auth"},{value:"header",label:"Header auth"},{value:"jwt",label:"JWT (HMAC)"}]},{key:"basicUser",label:"Username",type:"string",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"basicPassword",label:"Password",type:"secret",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"headerName",label:"Header name",type:"string",row:"header-auth",placeholder:"e.g. X-Api-Key",showIf:{field:"auth",equals:"header"}},{key:"headerValue",label:"Header value",type:"secret",row:"header-auth",showIf:{field:"auth",equals:"header"}},{key:"jwtSecret",label:"JWT secret",type:"secret",showIf:{field:"auth",equals:"jwt"}},{key:"responseMode",label:"Respond",type:"select",default:"onReceived",hint:"When and how to respond to the caller.",options:[{value:"onReceived",label:"Immediately (ASAP)"},{value:"lastNode",label:"When the run finishes"},{value:"responseNode",label:"Using a Response node"},{value:"streaming",label:"Streaming"}]},{key:"responseCode",label:"Response status code",type:"number",default:200,showIf:{field:"responseMode",notIn:["responseNode"]}},{key:"responseData",label:"Response body (immediate)",type:"text",hint:'Body for "Immediately" responses. Empty = { "runId": "run_…", "status": "started" }. Write {{ runId }} to include the run id.',showIf:{field:"responseMode",equals:"onReceived"}},{key:"rawBody",label:"Raw body",type:"boolean",default:!1,advanced:!0},{key:"ignoreBots",label:"Ignore bots",type:"boolean",default:!1,advanced:!0},{key:"ipAllowList",label:"IP allow list",type:"array",advanced:!0,item:{type:"string",placeholder:"e.g. 203.0.113.4"},hint:"Client IPs allowed to call this webhook. Empty = allow all."},{key:"binaryPropertyName",label:"Binary field name",type:"string",advanced:!0},{key:"cors",label:"CORS allowed origin",type:"string",advanced:!0},{key:"responseHeaders",label:"Response headers",type:"array",default:[],advanced:!0,item:{type:"object",fields:[{key:"name",label:"Name",type:"string"},{key:"value",label:"Value",type:"string"}]}}]},{app:mt,action:"submission",label:"Form",displayName:"On form submission",group:"trigger",icon:Nc,ports:{in:1,out:1},params:[{key:"form",label:"Form",type:"json",ui:"form-builder",whole:!0,default:wr(),hint:"The form's title, fields, pages and completion screen."},{key:"responseMode",label:"After submit",type:"select",default:"onSubmit",hint:"When the submitter sees the completion screen.",options:[{value:"onSubmit",label:"Show completion screen immediately"},{value:"lastNode",label:"Wait for the workflow to finish"},{value:"responseNode",label:"Using a Respond to Webhook step"}]},{key:"auth",label:"Authentication",type:"select",default:"none",hint:"Who may open and submit the form.",options:[{value:"none",label:"Anyone with the link"},{value:"basic",label:"Basic auth (username and password)"}]},{key:"basicUser",label:"Username",type:"string",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"basicPassword",label:"Password",type:"secret",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"ignoreBots",label:"Ignore bots",type:"boolean",default:!0,advanced:!0,hint:"Silently drop submissions from crawlers and link previewers."}]},{app:eo,action:"schedule",label:"Schedule",displayName:"Scheduler",group:"trigger",icon:xc,ports:{in:0,out:1},params:[{key:"mode",label:"Mode",type:"select",required:!0,default:"cron",hint:"How the schedule fires.",options:[{value:"once",label:"Once"},{value:"cron",label:"Cron"},{value:"interval",label:"Interval"}]},{key:"cron",label:"Cron expression",type:"string",placeholder:"e.g. 0 9 * * 1-5",showIf:{field:"mode",equals:"cron"}},{key:"runAt",label:"Run at",type:"string",placeholder:"e.g. 2026-01-01T09:00:00Z",showIf:{field:"mode",equals:"once"}},{key:"intervalSeconds",label:"Interval (seconds)",type:"number",showIf:{field:"mode",equals:"interval"}},{key:"timezone",label:"Timezone",type:"string",default:"UTC",advanced:!0}]},{app:Se,action:"if",label:"If",displayName:"If",group:"control",icon:ca,params:[{key:"condition",type:"json",label:"Condition",required:!0,default:!0,hint:"A boolean, or an expression like {{ nodes.x.output.ok }}."}]},{app:Se,action:"foreach",label:"For each",displayName:"For each",group:"control",icon:bc,params:[{key:"items",type:"json",label:"Items",required:!0,whole:!0,hint:"An array to iterate, or an expression binding to one."},{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per item. The canvas owns it; the engine requires it at run time."},{key:"parallelism",type:"number",label:"Parallelism",hidden:!0,hint:"Concurrent iterations. The engine clamps it to 1."}]},{app:Se,action:"while",label:"Repeat",displayName:"Repeat",group:"control",icon:ua,keywords:["while","loop","until","poll","retry","do while"],params:[{key:"maxIterations",type:"number",label:"Max passes",default:200,hint:"Stop after this many passes (1 to 10,000). The safety stop against a loop that never ends."},ba,{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per pass, ending with the Repeat? step. The canvas owns it; the engine requires it at run time."}],output:[{key:"iterations",label:"Passes run"},{key:"reachedMax",label:"Reached the limit"},{key:"last",label:"Last Repeat? decision"}]},{app:Se,action:"while-end",label:"Repeat?",displayName:"Repeat?",group:"control",icon:ua,hidden:!0,params:[{key:"continue",type:"json",label:"Repeat again",required:!0,whole:!0,default:!1,hint:"true runs another pass; false ends the loop. A boolean, or an expression such as {{ steps.poll.output.body.status != 'done' }}."}],output:[{key:"continue",label:"Repeat again"}]},{app:Se,action:"paginate",label:"Paginate",displayName:"Paginate",group:"control",icon:da,keywords:["pages","pagination","cursor","offset","next page","loop"],params:[{key:"start",type:"number",label:"First page",default:1,hint:"The first page number, read as loop.page. Use 0 for an API that takes an offset."},{key:"increment",type:"number",label:"Increment",default:1,hint:"Added to loop.page after each page: 1 for page numbers, the page size for offsets. May not be 0."},{key:"maxIterations",type:"number",label:"Max pages",default:200,hint:"Stop after this many pages (1 to 10,000). The safety stop against a loop that never ends."},ba,{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per page, ending with the Next page step. The canvas owns it; the engine requires it at run time."}],output:[{key:"pages",label:"Pages fetched"},{key:"reachedMax",label:"Reached the limit"},{key:"items",label:"All items"},{key:"continuation",label:"Last continuation"},{key:"meta",label:"Last meta"}]},{app:Se,action:"paginate-end",label:"Next page",displayName:"Next page",group:"control",icon:da,hidden:!0,params:[{key:"hasMore",type:"json",label:"Has more",required:!0,whole:!0,hint:"true fetches another page; false ends the loop. A boolean, or an expression such as {{ steps.fetch.output.body.has_more }}."},{key:"continuation",type:"string",label:"Continuation",hint:"A cursor or token for the next request, read there as loop.continuation. Empty means none."},{key:"meta",type:"json",label:"Meta",whole:!0,hint:"Any object to hand to the next pass, read there as loop.meta."},{key:"items",type:"json",label:"Items",whole:!0,hint:"This page's records (a list). Every page's items are collected into the Paginate step's items."}],output:[{key:"hasMore",label:"Has more"},{key:"continuation",label:"Continuation"},{key:"meta",label:"Meta"},{key:"items",label:"Items"}]},{app:Se,action:"parallel",label:"Parallel",displayName:"Parallel",group:"control",icon:yc,params:[]},{app:Se,action:"wait",label:"Wait",displayName:"Wait",group:"control",icon:gc,params:[{key:"duration",type:"string",label:"Duration",default:"1s",hint:"Use 30s, 1h30m30s, or 3d30s. Units: w, d, h, m, s; uppercase also works."}]},{app:xr,action:"run",label:"Run script",displayName:"Run script",group:"compute",icon:vc,params:[{key:"language",label:"Language",type:"select",default:"javascript",options:[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"}],hint:"Execution language for this step's code. TypeScript types are erased before it runs, not checked. Python runs CPython-on-WASM with no network."},{key:"code",type:"code",label:"Script",required:!0,scriptReads:!0,default:`// Runs as a function body. Return the step's output.
|
|
2
|
+
`)}function wr(){return{version:1,title:"Contact us",description:"We'll get back to you within one business day.",fields:[{id:"f_name",type:"text",name:"name",label:"Name",required:!0,width:"half"},{id:"f_email",type:"email",name:"email",label:"Email",required:!0,width:"half",placeholder:"you@example.com"},{id:"f_message",type:"textarea",name:"message",label:"Message",required:!0}],submitLabel:"Submit",completion:{type:"message",title:"Thank you!",message:"Your response has been recorded."},settings:{allowPrefill:!0,showProgress:!0,theme:"auto"}}}function Jl(e,t,s){const o={id:t,type:e};if(e==="pageBreak")return{...o,label:""};if(e==="heading")return{...o,label:"Section title"};if(e==="paragraph")return{...o,help:"Some helpful text."};const a=br[e],r={...o,label:a,name:Xs(yr(a),s)};return Zn.has(e)&&(r.options=[{label:"Option 1"},{label:"Option 2"}]),e==="rating"&&(r.max=5),e==="checkbox"&&(r.label="I agree"),r}const br={text:"Short text",textarea:"Long text",email:"Email",number:"Number",phone:"Phone",url:"Website",password:"Password",date:"Date",time:"Time",datetime:"Date & time",select:"Dropdown",radio:"Single choice",checkboxes:"Multiple choice",checkbox:"Checkbox",rating:"Rating",file:"File upload",hidden:"Hidden value",heading:"Heading",paragraph:"Paragraph",pageBreak:"Page break"};function yr(e){const t=e.toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48);return t?/^[0-9]/.test(t)?`f_${t}`:t:"field"}function Xs(e,t){if(!t.has(e))return e;let s=2;for(;t.has(`${e}_${s}`);)s++;return`${e}_${s}`}const Ze=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),we=e=>typeof e=="string"?e:void 0,sa=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0;function Kl(e){var l;let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return null}if(!Ze(t)||!Array.isArray(t.fields))return null;const s=[],o=[],a=new Set,r=new Set;for(const[c,u]of t.fields.slice(0,bs).entries()){if(!Ze(u)){s.push({message:`Field ${c+1} is not an object.`});continue}const d=we(u.type);if(!d||!Ml.includes(d)){s.push({message:`Field ${c+1} has an unknown type "${String(u.type)}".`});continue}let p=we(u.id)||`f_${c+1}`;r.has(p)&&(p=Xs(p,r)),r.add(p);const f=Gl(u,p,d);if(fr(d)&&(!f.name||!Wl.test(f.name)||Ul.has(f.name)?s.push({fieldId:p,message:`"${f.label||d}" needs a name made of letters, digits and _ (starting with a letter).`}):a.has(f.name)&&s.push({fieldId:p,message:`Two fields are named "${f.name}".`}),f.name&&a.add(f.name),Zn.has(d)&&!((l=f.options)!=null&&l.length)&&!f.optionsFrom&&s.push({fieldId:p,message:`"${f.label||f.name}" has no options.`}),f.pattern!==void 0))try{new RegExp(f.pattern)}catch{s.push({fieldId:p,message:`"${f.label||f.name}" has an invalid pattern.`})}const h=f.showIf;if(h&&!o.some(m=>m.name===h.field)){const m=f.label||f.name||d;s.push({fieldId:p,message:`"${m}" depends on "${h.field}", which is not an earlier field.`})}o.push(f)}t.fields.length>bs&&s.push({message:`A form holds at most ${bs} fields.`});const i={version:1,title:we(t.title)??"",fields:o};if(i.title.trim()||s.push({message:"The form needs a title."}),we(t.description)&&(i.description=we(t.description)),we(t.submitLabel)&&(i.submitLabel=we(t.submitLabel)),Ze(t.completion)){const c=t.completion,u={type:c.type==="redirect"?"redirect":"message"};we(c.title)!==void 0&&(u.title=we(c.title)),we(c.message)!==void 0&&(u.message=we(c.message)),we(c.redirectUrl)!==void 0&&(u.redirectUrl=we(c.redirectUrl)),c.allowAnother===!0&&(u.allowAnother=!0),u.type==="redirect"&&!Xl(u.redirectUrl)&&s.push({message:"The redirect URL must start with http:// or https://."}),i.completion=u}if(Ze(t.settings)){const c=t.settings,u={};typeof c.allowPrefill=="boolean"&&(u.allowPrefill=c.allowPrefill),typeof c.showProgress=="boolean"&&(u.showProgress=c.showProgress),(c.theme==="light"||c.theme==="dark"||c.theme==="auto")&&(u.theme=c.theme),typeof c.accentColor=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(c.accentColor)&&(u.accentColor=c.accentColor),we(c.customCss)&&(u.customCss=we(c.customCss)),c.hideBranding===!0&&(u.hideBranding=!0),c.closed===!0&&(u.closed=!0),we(c.closedMessage)&&(u.closedMessage=we(c.closedMessage)),i.settings=u}return{form:i,problems:s}}function Gl(e,t,s){const o={id:t,type:s};for(const r of["name","label","help","placeholder","pattern","patternMessage"]){const i=we(e[r]);i!==void 0&&i!==""&&(o[r]=i)}for(const r of["minDate","maxDate","accept"]){const i=we(e[r]);i&&(o[r]=i)}e.required===!0&&(o.required=!0),e.multiple===!0&&(o.multiple=!0),e.allowOther===!0&&(o.allowOther=!0);for(const r of["minLength","maxLength","min","max","step","minSelected","maxSelected","rows","maxFileSizeMb","maxFiles"]){const i=sa(e[r]);i!==void 0&&(o[r]=i)}const a=e.defaultValue;if((typeof a=="string"||typeof a=="boolean"||sa(a)!==void 0||Array.isArray(a)&&a.every(r=>typeof r=="string"))&&(o.defaultValue=a),Array.isArray(e.options)&&(o.options=e.options.flatMap(r=>{if(typeof r=="string")return r?[{label:r}]:[];if(!Ze(r))return[];const i=we(r.label)??we(r.value);if(!i)return[];const l={label:i};return we(r.value)&&(l.value=we(r.value)),[l]})),Zn.has(s)){const r=oa(e.optionsFrom);r&&(o.optionsFrom=r,Array.isArray(r.items)&&(o.options=ra(r.items,r)))}if(s==="text"){if(Array.isArray(e.suggestions)){const i=e.suggestions.filter(l=>typeof l=="string"&&l!=="");i.length&&(o.suggestions=i.slice(0,mr))}const r=oa(e.suggestionsFrom);r&&(o.suggestionsFrom=r,Array.isArray(r.items)&&(o.suggestions=[...new Set(ra(r.items,r).map(i=>i.label))]))}if(e.width==="half"&&(o.width="half"),Ze(e.showIf)&&we(e.showIf.field)){const r=hr.includes(String(e.showIf.op))?e.showIf.op:"equals";o.showIf={field:String(e.showIf.field),op:r},e.showIf.value!==void 0&&e.showIf.value!==null&&(o.showIf.value=String(e.showIf.value))}return o}function oa(e){var a,r;if(!Ze(e)||e.items===void 0||e.items===null||e.items==="")return;const t={items:e.items},s=(a=we(e.label))==null?void 0:a.trim(),o=(r=we(e.value))==null?void 0:r.trim();return s&&(t.label=s),o&&(t.value=o),t}function Yl(e,t){let s=e;for(const o of t.split(".")){if(!Ze(s)||!Object.hasOwn(s,o))return;s=s[o]}return s}function aa(e){if(typeof e=="string")return e===""?void 0:e;if(typeof e=="number"&&Number.isFinite(e)||typeof e=="boolean")return String(e)}function ra(e,t={}){const s=[],o=new Set,a=(r,i)=>{for(const l of i){const c=aa(Yl(r,l));if(c!==void 0)return c}};for(const r of e){if(s.length>=mr)break;let i,l;if(Ze(r)){const c=a(r,t.value?[t.value]:["value","id"]);i=a(r,t.label?[t.label]:["label","name","title"])??c,l=c??i}else i=l=aa(r);i===void 0||l===void 0||o.has(l)||(o.add(l),s.push(l===i?{label:i}:{label:i,value:l}))}return s}function Xl(e){return typeof e=="string"&&/^https?:\/\/\S+$/i.test(e.trim())}function kn(e,t){const s=e==="error"?{className:"w6w-edge-error",label:"on error"}:e==="each"?{className:"w6w-edge-each"}:{};if(!t)return s;const o=t==="taken"?"w6w-edge-taken":"w6w-edge-skipped";return{className:s.className?`${s.className} ${o}`:o,...s.label?{label:s.label}:{}}}const Qs="out-error",es="out-each",et="done",gr="each";function Zs(e){return e==="error"?Qs:e==="each"?es:void 0}function Ql(e){return e===Qs?"error":e===es?"each":"success"}const Zl="@w6w/",Se="@w6w/control",xr="@w6w/script",fn="@w6w/data",Yt="@w6w/trigger",ec="@w6w/http",Ke="@w6w/webhook",eo="@w6w/scheduler",mt="@w6w/form",tc="@w6w/respond",jn="@w6w/call",to="@w6w/document",Tn="@w6w/model",nc="@w6w/template",On="@w6w/regex",sc="@w6w/string",oc="@w6w/number",Je="@w6w/store",qt="@w6w/csv",ac="@w6w/files",rc="@w6w/datetime",ic="@w6w/crypto",lc="@w6w/list",no="@w6w/stop",nt="@w6w/router",Xt="@w6w/race",vr="Continue once with the first arriving path’s output. Later arrivals are ignored for this run. Other paths keep running.";function so(e){var t;return e.uses.app!==nt||!Array.isArray((t=e.with)==null?void 0:t.routes)?[]:e.with.routes.filter(s=>!!s&&typeof s=="object"&&typeof s.id=="string")}const Qt=e=>`route:${e}`,cc=e=>e!=null&&e.startsWith("route:")?e.slice(6):void 0,uc=3,dc=16;function pc(e){const t=e.find(a=>a.default),s=a=>({id:a.id,handleId:Qt(a.id),label:a.default?"Fallback":a.label||a.id}),o=e.filter(a=>a!==t);return{right:o.map((a,r)=>({...s(a),top:`${(r+.5)/o.length*100}%`})),...t?{bottom:s(t)}:{},...o.length>uc?{minHeight:o.length*dc}:{}}}const Bn="false";function oo(e){return e.uses.app===Se&&e.uses.action==="if"}function fc(){return{right:[{id:"true",label:"True",top:"50%"}],bottom:{id:Bn,handleId:Qt(Bn),label:"False"}}}function pt(e){return e.startsWith(Zl)}function Ht(e){return e===Se||e===Xt}function Hn(e){return e===Yt||e===Ke||e===eo||e===mt}function hc(e){return Hn(e.app)||e.trigger===!0}const ia={in:1,out:Number.POSITIVE_INFINITY};function la(e){return e==="many"?Number.POSITIVE_INFINITY:typeof e=="number"?e:void 0}function mc(...e){let t,s;for(const o of e)t??(t=la(o==null?void 0:o.in)),s??(s=la(o==null?void 0:o.out));return{in:t??ia.in,out:s??ia.out}}function hn(e,t){var r;if(e.uses.app===nt)return{in:1,out:so(e).length};const{app:s,action:o}=e.uses,a=e.uses.trigger?{in:0,out:1}:void 0;return mc(e.ports,t==null?void 0:t(s,o),((r=Pt(s,o))==null?void 0:r.ports)??a)}const wc='<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />',ca='<line x1="6" y1="3" x2="6" y2="15" /><circle cx="18" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><path d="M18 9a9 9 0 0 1-9 9" />',bc='<polyline points="17 1 21 5 17 9" /><path d="M3 11V9a4 4 0 0 1 4-4h14" /><polyline points="7 23 3 19 7 15" /><path d="M21 13v2a4 4 0 0 1-4 4H3" />',ua='<polyline points="23 4 23 10 17 10" /><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />',da='<rect x="3" y="5" width="12" height="16" rx="1" /><path d="M7 3h11a1 1 0 0 1 1 1v13" /><polyline points="16 13 19 16 22 13" />',yc='<line x1="6" y1="4" x2="6" y2="20" /><line x1="12" y1="4" x2="12" y2="20" /><line x1="18" y1="4" x2="18" y2="20" />',gc='<circle cx="12" cy="12" r="9" /><polyline points="12 7 12 12 15 14" />',xc='<rect x="3" y="4" width="18" height="18" rx="2" /><line x1="16" y1="2" x2="16" y2="6" /><line x1="8" y1="2" x2="8" y2="6" /><line x1="3" y1="10" x2="21" y2="10" /><polyline points="12 13 12 16 14 17" />',vc='<polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" />',pa='<ellipse cx="12" cy="5" rx="9" ry="3" /><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" /><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" />',kc='<circle cx="12" cy="12" r="10" /><line x1="2" y1="12" x2="22" y2="12" /><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />',jc='<circle cx="18" cy="5" r="3" /><circle cx="6" cy="12" r="3" /><circle cx="18" cy="19" r="3" /><line x1="8.59" y1="13.51" x2="15.42" y2="17.49" /><line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />',Nc='<rect x="4" y="3" width="16" height="18" rx="2" /><line x1="8" y1="8" x2="16" y2="8" /><rect x="8" y="11" width="8" height="3" rx="1" /><line x1="8" y1="17.5" x2="12" y2="17.5" />',Sc='<polyline points="9 17 4 12 9 7" /><path d="M20 18v-2a4 4 0 0 0-4-4H4" />',fa='<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" />',Cc='<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /><polyline points="15 3 21 3 21 9" /><line x1="10" y1="14" x2="21" y2="3" />',Ac='<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" />',ys='<rect x="4" y="4" width="16" height="16" rx="2" /><rect x="9" y="9" width="6" height="6" /><line x1="9" y1="1" x2="9" y2="4" /><line x1="15" y1="1" x2="15" y2="4" /><line x1="9" y1="20" x2="9" y2="23" /><line x1="15" y1="20" x2="15" y2="23" /><line x1="20" y1="9" x2="23" y2="9" /><line x1="20" y1="14" x2="23" y2="14" /><line x1="1" y1="9" x2="4" y2="9" /><line x1="1" y1="14" x2="4" y2="14" />',Ec='<rect x="4" y="8" width="16" height="12" rx="2" /><line x1="12" y1="4" x2="12" y2="8" /><circle cx="12" cy="3" r="1" /><circle cx="9" cy="14" r="1.2" /><circle cx="15" cy="14" r="1.2" /><line x1="2" y1="13" x2="2" y2="16" /><line x1="22" y1="13" x2="22" y2="16" />',Tc='<path d="M8 3H7a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1" /><path d="M16 3h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-1" />',lt='<ellipse cx="12" cy="5" rx="9" ry="3" /><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" /><path d="M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3" />',Wt='<rect x="3" y="4" width="18" height="16" rx="2" /><line x1="3" y1="10" x2="21" y2="10" /><line x1="3" y1="15" x2="21" y2="15" /><line x1="9" y1="4" x2="9" y2="20" />',Oc='<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" /><polyline points="14 3 14 8 19 8" /><line x1="12" y1="11" x2="12" y2="17" /><polyline points="9.5 14.5 12 17 14.5 14.5" />',Rc=[{app:On,hidden:!0,action:"match",label:"Extract",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"Enter a regular expression without enclosing / delimiters. The extracted value is the first capture group, or the full match if there are no capture groups."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"value",label:"Extracted value"},{key:"matched",label:"Matched"},{key:"matches",label:"Matches"}]},{app:On,hidden:!0,action:"test",label:"Test",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"matched",label:"Matched"}]},{app:On,hidden:!0,action:"replace",label:"Replace",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."},{key:"replacement",label:"Replacement",type:"string",config:{multiline:!0},default:"",hint:"Replacement text; supports $1, $<name>, $&, $$, $` and $'. Leave empty to remove matches."}],output:[{key:"result",label:"Result"}]},{app:On,hidden:!0,action:"split",label:"Split",displayName:"Regex",groupActions:!0,group:"compute",icon:'<circle cx="6" cy="17" r="1"/><path d="M16 4v12M11 7l10 6M11 13l10-6"/>',params:[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"Text to process. Empty text is allowed."},{key:"pattern",label:"Pattern",type:"string",default:"",hint:"JavaScript regular expression without / delimiters. An empty pattern matches an empty string."},{key:"flags",label:"Flags",type:"string",default:"",hint:"Optional flags: d, g, i, m, s, u, v, y. Use g for all matches or replacements; u and v cannot be combined."}],output:[{key:"parts",label:"Parts"}]}],Ic=[{app:qt,action:"from-json",label:"From JSON",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"items",label:"Items",type:"json",required:!0,hint:"A list of objects, one per row."},{key:"csv",label:"Table",type:"json",hint:"Optional table to append to. Its columns stay first.",required:!1},{key:"columns",label:"Columns",type:"json",hint:"Optional column names, in order. Keys not listed are dropped."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"create",label:"Create table",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"columns",label:"Columns",type:"json",hint:"Column names, in order. Leave empty to use the keys of the rows."},{key:"rows",label:"Rows",type:"json",hint:"Optional list of row objects."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"add-rows",label:"Add rows",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"rows",label:"Rows",type:"json",required:!0,hint:"A list of row objects to append."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"remove-rows",label:"Remove rows",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"indexes",label:"Row positions",type:"json",hint:"Zero-based positions to remove. Use this or Match, not both."},{key:"where",label:"Match",type:"json",hint:'An object such as { "status": "done" }. A row is removed when every listed column equals its value exactly ("1" is not 1).'}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]},{app:qt,action:"to-text",label:"To CSV text",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"csv",label:"Table",type:"json",hint:"A table: { columns: string[], rows: object[] }. Usually the output of another CSV step.",required:!0},{key:"delimiter",label:"Delimiter",type:"string",default:",",hint:"One of , ; | or a tab."},{key:"header",label:"Header row",type:"boolean",default:!0,hint:"Write the column names as the first line."},{key:"bom",label:"Byte order mark",type:"boolean",default:!1,hint:"Start the text with U+FEFF, which some spreadsheet apps need for UTF-8."},{key:"escapeFormulas",label:"Escape formulas",type:"boolean",default:!1,hint:"Prefix text starting with = + - @ tab or CR with an apostrophe so spreadsheets do not run it. This breaks an exact round trip."},{key:"file",label:"Also create a file",type:"boolean",default:!1,hint:"Create a downloadable text/csv file as well as the text."},{key:"filename",label:"File name",type:"string",default:"data.csv",hint:"Used when a file is created. 1 to 255 characters, no slashes."}],output:[{key:"text",label:"Text"},{key:"file",label:"File"}]},{app:qt,action:"parse",label:"Parse CSV",displayName:"CSV",groupActions:!0,group:"compute",icon:Wt,params:[{key:"text",label:"Text",type:"text",hint:"CSV text. Use this or File."},{key:"file",label:"File",type:"file",hint:"A CSV file from an earlier step. Use this or Text."},{key:"delimiter",label:"Delimiter",type:"string",default:",",hint:"One of , ; | or a tab."},{key:"header",label:"Header row",type:"boolean",default:!0,hint:"Off names the columns column_1, column_2 and so on."},{key:"inferTypes",label:"Detect types",type:"boolean",default:!0,hint:"Off keeps every cell as text."}],output:[{key:"columns",label:"Columns"},{key:"rows",label:"Rows"}]}],$c='<rect x="3" y="4" width="18" height="17" rx="2" /><line x1="3" y1="9" x2="21" y2="9" /><line x1="8" y1="2.5" x2="8" y2="6" /><line x1="16" y1="2.5" x2="16" y2="6" /><polyline points="12 12 12 15.5 14.5 17" />',Pc='<rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /><line x1="12" y1="15" x2="12" y2="17" />',_c='<line x1="9" y1="6" x2="20" y2="6" /><line x1="9" y1="12" x2="20" y2="12" /><line x1="9" y1="18" x2="20" y2="18" /><circle cx="4.5" cy="6" r="1" /><circle cx="4.5" cy="12" r="1" /><circle cx="4.5" cy="18" r="1" />',kr="An ISO 8601 date or date-time (with or without an offset), an RFC 2822 / HTTP date, or an epoch number: below 100,000,000,000 it is seconds, otherwise milliseconds. A date without an offset is read in the time zone. Leave empty, or write now, for the current time.",ha="yyyy yy (year), MMMM MMM MM M (month), dd d (day), EEEE EEE (weekday), HH H (hour 0-23), hh h (hour 1-12), mm m (minute), ss s (second), SSS (milliseconds), a (AM/PM), XXX (offset, Z for UTC), xxx (+02:00), xx (+0200), VV (zone name), Q (quarter), ww w (ISO week). Put literal letters in single quotes, e.g. yyyy-MM-dd'T'HH:mm.",Et=e=>({key:"timezone",label:"Time zone",type:"string",default:"",hint:`${e} An IANA name such as Europe/Berlin or America/New_York. Leave empty for UTC.`}),Tt=(e="date",t="Date")=>({key:e,label:t,type:"string",default:"",hint:kr}),jr=[{value:"years",label:"Years"},{value:"quarters",label:"Quarters"},{value:"months",label:"Months"},{value:"weeks",label:"Weeks"},{value:"days",label:"Days"},{value:"hours",label:"Hours"},{value:"minutes",label:"Minutes"},{value:"seconds",label:"Seconds"},{value:"milliseconds",label:"Milliseconds"}],Ot=[{key:"iso",label:"ISO 8601"},{key:"epochMs",label:"Epoch milliseconds"},{key:"timezone",label:"Time zone"},{key:"offset",label:"UTC offset"}],ut=(e,t,s,o)=>({app:rc,action:e,label:t,displayName:"Date & Time",groupActions:!0,group:"compute",icon:$c,params:s,output:o}),ma=e=>ut(e,e==="add"?"Add":"Subtract",[Tt(),{key:"amount",label:"Amount",type:"number",default:1,hint:`How much to ${e}. Whole number for years to days; hours and smaller may have decimals.`},{key:"unit",label:"Unit",type:"select",default:"days",options:jr,hint:"Days and larger follow the calendar in the time zone (the clock time is kept across daylight saving); hours and smaller are exact elapsed time."},Et("Where calendar math happens.")],Ot),Fc=[ut("now","Now",[Et("The zone to show the time in."),{key:"format",label:"Format",type:"string",default:"",hint:"Optional. A preset (iso, date, time, datetime, rfc2822, http, epoch, epoch_ms) or a pattern. When set, the output also has a formatted value."}],[...Ot,{key:"formatted",label:"Formatted"}]),ut("format","Format",[Tt(),{key:"format",label:"Format",type:"string",default:"iso",hint:`A preset: iso, date (yyyy-MM-dd), time (HH:mm:ss), datetime, rfc2822, http (GMT), epoch (seconds), epoch_ms. Or a pattern using: ${ha}`},Et("The zone the date is shown in."),{key:"locale",label:"Locale",type:"string",default:"",hint:"Language for month and weekday names, e.g. de-DE. Leave empty for en-US."}],[...Ot,{key:"formatted",label:"Formatted"}]),ut("parse","Parse",[{key:"text",label:"Text",type:"string",default:"",hint:"The text to read. With no format it is detected: ISO 8601, epoch seconds or milliseconds, or an RFC 2822 / HTTP date."},{key:"format",label:"Format",type:"string",default:"",hint:`Optional pattern the text follows, using: ${ha} Missing parts default to 1970-01-01 00:00:00. Q, w and ww are not available for parsing.`},Et("The zone for text that carries no offset."),{key:"locale",label:"Locale",type:"string",default:"",hint:"Language of month and weekday names in the text. Leave empty for en-US."}],Ot),ma("add"),ma("subtract"),ut("difference","Difference",[Tt("start","Start"),Tt("end","End"),{key:"unit",label:"Unit",type:"select",default:"days",options:jr,hint:"Years, quarters and months are calendar-aware; weeks and smaller are elapsed time. Only complete units count."},Et("Where calendar math happens.")],[{key:"value",label:"Difference"},{key:"unit",label:"Unit"},{key:"start",label:"Start (ISO 8601)"},{key:"end",label:"End (ISO 8601)"},{key:"timezone",label:"Time zone"}]),ut("extract","Extract part",[Tt(),{key:"part",label:"Part",type:"select",default:"year",options:[{value:"year",label:"Year"},{value:"quarter",label:"Quarter"},{value:"month",label:"Month"},{value:"week",label:"Week (ISO)"},{value:"day",label:"Day of month"},{value:"dayOfWeek",label:"Day of week (1 = Monday)"},{value:"dayOfYear",label:"Day of year"},{value:"hour",label:"Hour"},{value:"minute",label:"Minute"},{value:"second",label:"Second"},{value:"millisecond",label:"Millisecond"}],hint:"Which part to read, in the time zone."},Et("The zone the part is read in.")],[{key:"value",label:"Value"},{key:"part",label:"Part"},...Ot]),ut("round","Round",[Tt(),{key:"unit",label:"Unit",type:"select",default:"day",options:[{value:"year",label:"Year"},{value:"quarter",label:"Quarter"},{value:"month",label:"Month"},{value:"week",label:"Week (starts Monday)"},{value:"day",label:"Day"},{value:"hour",label:"Hour"},{value:"minute",label:"Minute"},{value:"second",label:"Second"}],hint:"The boundary to round to, in the time zone."},{key:"direction",label:"Direction",type:"select",default:"down",options:[{value:"down",label:"Down (start of the unit)"},{value:"up",label:"Up (next boundary)"},{value:"nearest",label:"Nearest"}],hint:"Up leaves a date that is already on a boundary unchanged; nearest rounds halfway up."},Et("Where the boundaries are.")],[...Ot,{key:"unit",label:"Unit"},{key:"direction",label:"Direction"}]),ut("convert","Convert time zone",[{...Tt(),hint:kr.replace("in the time zone","as UTC")},{key:"timezone",label:"Time zone",type:"string",default:"",hint:"The zone to show it in: an IANA name such as Asia/Tokyo, or UTC."}],Ot)],gs=e=>({key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:e}),xs={key:"algorithm",label:"Algorithm",type:"select",default:"sha256",options:[{value:"sha256",label:"SHA-256"},{value:"sha1",label:"SHA-1"},{value:"sha384",label:"SHA-384"},{value:"sha512",label:"SHA-512"}],hint:"Hash function. SHA-256 is the usual choice; SHA-1 is only for vendors that still require it."},vs=e=>({key:"encoding",label:"Encoding",type:"select",default:"hex",options:[{value:"hex",label:"Hex"},{value:"base64",label:"Base64"},{value:"base64url",label:"Base64 URL-safe"}],hint:e}),wa=[{key:"key",label:"Key",type:"string",default:"",hint:"The shared secret. Use a vault secret, e.g. {{ secrets.webhook_signing_key }}. It is never returned in the output."},{key:"keyEncoding",label:"Key encoding",type:"select",default:"utf8",options:[{value:"utf8",label:"Plain text"},{value:"hex",label:"Hex"},{value:"base64",label:"Base64"}],hint:"How the key is written. Most vendors give a plain-text key; some give hex or Base64."}],on=(e,t,s,o)=>({app:ic,action:e,label:t,displayName:"Crypto",groupActions:!0,group:"compute",icon:Pc,params:s,output:o}),Lc=[on("hash","Hash",[gs("Text to hash, up to 10 MB. Empty text is allowed."),xs,vs("How the digest is written.")],[{key:"digest",label:"Digest"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("hmac","HMAC",[gs("The message to sign, up to 10 MB."),...wa,xs,vs("How the signature is written.")],[{key:"digest",label:"Signature"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("verify-hmac","Verify HMAC",[gs("The signed message, usually the raw request body."),...wa,xs,vs("How the expected signature is written."),{key:"signature",label:"Signature",type:"string",default:"",hint:"The signature to check, in the encoding above (e.g. from the request's signature header). The comparison is constant-time."}],[{key:"valid",label:"Valid"},{key:"algorithm",label:"Algorithm"},{key:"encoding",label:"Encoding"}]),on("uuid","UUID",[{key:"count",label:"Count",type:"number",default:1,hint:"How many UUIDs, from 1 to 1000."}],[{key:"uuid",label:"UUID"},{key:"uuids",label:"UUIDs"}]),on("random","Random",[{key:"length",label:"Length",type:"number",default:32,hint:"Number of random bytes (1 to 4096). For Alphanumeric it is the number of characters instead."},{key:"encoding",label:"Encoding",type:"select",default:"hex",options:[{value:"hex",label:"Hex"},{value:"base64",label:"Base64"},{value:"base64url",label:"Base64 URL-safe"},{value:"alphanumeric",label:"Letters and digits"}],hint:"How the random value is written."}],[{key:"value",label:"Value"},{key:"encoding",label:"Encoding"},{key:"length",label:"Length"}])],At={key:"items",label:"Items",type:"json",required:!0,hint:"The list to work on. Bind the array itself, e.g. {{ steps.fetch.output.body.data }}, not the whole response."},an={key:"items",label:"Items"},Mc="A dot path into each item, such as user.email or tags.0. Leave empty to use the item itself.",ct=(e,t,s,o)=>({app:lc,action:e,label:t,displayName:"List",groupActions:!0,group:"compute",icon:_c,params:s,output:o}),Dc=[ct("filter","Filter",[At,{key:"conditions",label:"Conditions",type:"json",required:!0,hint:'A list such as [{ "field": "status", "operator": "equals", "value": "paid" }]. Operators: equals, not_equals, gt, gte, lt, lte, contains, not_contains, starts_with, ends_with, matches (regular expression, up to 500 characters), in, not_in (value is a list), exists, not_exists, is_empty, is_not_empty, is_true, is_false. Numbers and ISO dates compare by value; other text compares as plain text.'},{key:"combine",label:"Combine conditions",type:"select",default:"and",options:[{value:"and",label:"All must match"},{value:"or",label:"Any can match"}]},{key:"caseSensitive",label:"Case sensitive",type:"boolean",default:!0,hint:"Turn off to ignore upper and lower case in text comparisons."}],[an,{key:"kept",label:"Kept"},{key:"removed",label:"Removed"}]),ct("sort","Sort",[At,{key:"by",label:"Sort by",type:"json",required:!0,hint:'A list such as [{ "field": "createdAt", "direction": "desc" }]. Direction is asc (default) or desc. Later entries break ties.'}],[an]),ct("limit","Limit",[At,{key:"count",label:"Count",type:"number",required:!0,hint:"How many to keep."},{key:"from",label:"Keep from",type:"select",default:"start",options:[{value:"start",label:"Start of the list"},{value:"end",label:"End of the list"}]},{key:"offset",label:"Skip",type:"number",default:0,hint:"How many items to skip from that end first."}],[an]),ct("pluck","Extract field",[At,{key:"field",label:"Field",type:"string",hint:Mc},{key:"unique",label:"Only distinct values",type:"boolean",default:!1},{key:"skipEmpty",label:"Skip empty values",type:"boolean",default:!1,hint:"Leave out missing, null and empty-text values."}],[{key:"values",label:"Values"}]),ct("unique","Remove duplicates",[At,{key:"fields",label:"Compare fields",type:"json",hint:'A list of field paths such as ["email"]. Leave empty to compare the whole item exactly.'},{key:"keep",label:"Keep",type:"select",default:"first",options:[{value:"first",label:"First occurrence"},{value:"last",label:"Last occurrence"}]}],[an,{key:"removed",label:"Removed items"}]),ct("chunk","Split into batches",[At,{key:"size",label:"Batch size",type:"number",required:!0,default:10}],[{key:"chunks",label:"Batches"},{key:"count",label:"Number of batches"}]),ct("join","Merge lists",[{key:"left",label:"First list",type:"json",required:!0,hint:"Bind the array itself, not the whole response."},{key:"right",label:"Second list",type:"json",required:!0,hint:"Bind the array itself, not the whole response."},{key:"mode",label:"Combine by",type:"select",default:"field",options:[{value:"field",label:"Matching field"},{value:"position",label:"Position"},{value:"all",label:"Every pair"}]},{key:"leftField",label:"Field in first list",type:"string",hint:"Needed when combining by matching field. Text and numbers match by value."},{key:"rightField",label:"Field in second list",type:"string",hint:"Leave empty to use the same field as the first list."},{key:"type",label:"Keep",type:"select",default:"inner",options:[{value:"inner",label:"Only matches"},{value:"left",label:"All of the first list"},{value:"right",label:"All of the second list"},{value:"full",label:"Everything from both"}]},{key:"multipleMatches",label:"When several match",type:"select",default:"all",options:[{value:"all",label:"Keep every match"},{value:"first",label:"Keep the first match"}]},{key:"clash",label:"When fields share a name",type:"select",default:"right",options:[{value:"right",label:"Second list wins"},{value:"left",label:"First list wins"},{value:"prefix",label:"Keep both (prefix second with right_)"}]}],[an]),ct("summarize","Summarize",[At,{key:"groupBy",label:"Group by",type:"json",hint:'A list of field paths such as ["country"]. Leave empty for one overall result.'},{key:"aggregations",label:"Calculations",type:"json",required:!0,hint:'A list such as [{ "field": "amount", "op": "sum", "as": "total" }]. Ops: count, count_unique, sum, avg, min, max, first, last, append, concat (add "separator", default ", "). Without "as" the result is named like sum_amount.'}],[{key:"groups",label:"Groups"}])],qc='<path d="M4 7V5h11v2M9.5 5v14M7.5 19h4" /><path d="M15 13h6M15 17h4" />',We=(e,t,s,o,a)=>({app:sc,action:e,label:t,displayName:"Text",groupActions:!0,group:"compute",icon:qc,keywords:s,params:o,output:a}),Wc=[We("check","Check text",["regex","regular expression","regexp","contains","includes","starts with","ends with","equals","test","match","if"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"mode",label:"Check that the text",type:"select",default:"contains",options:[{value:"contains",label:"Contains"},{value:"starts-with",label:"Starts with"},{value:"ends-with",label:"Ends with"},{value:"equals",label:"Is exactly"},{value:"pattern",label:"Matches a pattern (regex)"}]},{key:"value",label:"Value",type:"string",default:"",hint:"The text to look for. For a pattern, a regular expression without / delimiters, such as ^INV-\\d+$."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"mode",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."}],[{key:"matched",label:"Matched"}]),We("extract","Extract values",["regex","regular expression","regexp","parse","find","scrape","email","url","link","phone","number","hashtag","mention","capture group"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"what",label:"Extract",type:"select",default:"email",options:[{value:"email",label:"Email addresses"},{value:"url",label:"Links (URLs)"},{value:"phone",label:"Phone numbers"},{value:"number",label:"Numbers"},{value:"hashtag",label:"#Hashtags"},{value:"mention",label:"@Mentions"},{value:"pattern",label:"A pattern (regex)"}]},{key:"pattern",label:"Pattern",type:"string",default:"",showIf:{field:"what",equals:"pattern"},hint:"A regular expression without / delimiters. Each value is its first capture group, or the whole match when it has none."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"what",equals:"pattern"},hint:"Optional: i (ignore case), m (^ and $ match at each line), s (. matches newlines), u (Unicode)."},{key:"all",label:"Every match",type:"boolean",default:!0,hint:"Turn off to return only the first match."},{key:"unique",label:"Drop repeats",type:"boolean",default:!1,hint:"Return each value once."}],[{key:"value",label:"First value"},{key:"values",label:"Values"},{key:"matched",label:"Found any"},{key:"count",label:"Count"},{key:"matches",label:"Matches"}]),We("replace","Find and replace",["regex","regular expression","regexp","substitute","find and replace","remove","sed","gsub"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"mode",label:"Find",type:"select",default:"text",options:[{value:"text",label:"Plain text"},{value:"pattern",label:"A pattern (regex)"}]},{key:"find",label:"Find what",type:"string",default:"",hint:"The text to find. For a pattern, a regular expression without / delimiters."},{key:"replacement",label:"Replace with",type:"string",config:{multiline:!0},default:"",hint:"The new text. For a pattern, $1, $<name> and $& insert what was matched. Leave empty to remove matches."},{key:"all",label:"Every match",type:"boolean",default:!0,hint:"Turn off to replace only the first match."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"mode",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."}],[{key:"result",label:"Result"}]),We("split","Split text",["regex","regular expression","regexp","explode","tokenize","separate","delimiter","lines","words","characters"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"by",label:"Split by",type:"select",default:"separator",options:[{value:"separator",label:"A separator"},{value:"pattern",label:"A pattern (regex)"},{value:"lines",label:"Lines"},{value:"words",label:"Words"},{value:"characters",label:"Characters"}]},{key:"separator",label:"Separator",type:"string",default:",",showIf:{field:"by",equals:"separator"},hint:"The text between parts, such as , or ; or |. Empty splits into characters."},{key:"pattern",label:"Pattern",type:"string",default:"",showIf:{field:"by",equals:"pattern"},hint:"A regular expression without / delimiters. Captured groups are kept as parts."},{key:"flags",label:"Regex flags",type:"string",default:"",showIf:{field:"by",equals:"pattern"},hint:"Optional: m (^ and $ match at each line), s (. matches newlines), u (Unicode)."},{key:"trim",label:"Trim parts",type:"boolean",default:!0,hint:"Remove spaces around each part."},{key:"removeEmpty",label:"Drop empty parts",type:"boolean",default:!1}],[{key:"parts",label:"Parts"},{key:"count",label:"Count"}]),We("similarity","Similarity",["fuzzy","fuzzy match","compare","similar","distance","edit distance","levenshtein","jaro","winkler","dice","jaccard","soundex","phonetic","sounds like","typo","ratio","difflib","rapidfuzz","damerau","transposition","token set","token sort","sorensen","sørensen","bigram","ratcliff","obershelp","gestalt","lcs","longest common subsequence"],[{key:"a",label:"First text",type:"string",config:{multiline:!0},default:""},{key:"b",label:"Second text",type:"string",config:{multiline:!0},default:""},{key:"method",label:"How to compare",type:"select",default:"auto",options:[{value:"auto",label:"Best overall (a blend of three)"},{value:"jaro-winkler",label:"Typos and names (Jaro–Winkler)"},{value:"levenshtein",label:"Character edits (Levenshtein)"},{value:"damerau",label:"Edits and swapped letters (Damerau–Levenshtein)"},{value:"token-set",label:"Same words, extra words allowed (token set)"},{value:"token-sort",label:"Same words, any order (token sort)"},{value:"dice",label:"Letter pairs (Sørensen–Dice)"},{value:"jaccard",label:"Shared words (Jaccard)"},{value:"ratcliff",label:"Common runs of text (Ratcliff–Obershelp)"},{value:"lcs",label:"Letters in order (longest common subsequence)"},{value:"soundex",label:"Sounds alike (Soundex)"}],hint:"Best overall averages Jaro–Winkler, token set and letter pairs, and shows each score in Breakdown."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!0,hint:"Treat upper and lower case as the same."},{key:"ignoreAccents",label:"Ignore accents",type:"boolean",default:!0,hint:"Treat é as e and ü as u."},{key:"ignorePunctuation",label:"Ignore punctuation",type:"boolean",default:!0,hint:"Treat punctuation and symbols as spaces: “Acme, Inc.” matches “Acme Inc”."},{key:"ignoreStopWords",label:"Ignore connecting words",type:"boolean",default:!1,hint:"Skip stop words such as the, a, of and and, so “The Bank of America” matches “Bank America”."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"ignoreStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"score",label:"Score"},{key:"method",label:"Method"},{key:"distance",label:"Edits"},{key:"breakdown",label:"Breakdown"},{key:"keys",label:"Sound codes"},{key:"normalized",label:"Compared as"}]),We("best-match","Best match",["fuzzy","fuzzy lookup","closest","nearest","lookup","vlookup","did you mean","autocorrect","levenshtein","jaro","rank"],[{key:"text",label:"Text to match",type:"string",default:"",hint:"The text to look up, such as a company name from a form."},{key:"candidates",label:"List to search",type:"json",required:!0,hint:"Texts, or objects with Field set. Bind the array itself, e.g. {{ steps.accounts.output.body.data }}."},{key:"field",label:"Field",type:"string",hint:"For a list of objects, the dot path of the text to compare, such as name or company.name."},{key:"method",label:"How to compare",type:"select",default:"auto",options:[{value:"auto",label:"Best overall (a blend of three)"},{value:"jaro-winkler",label:"Typos and names (Jaro–Winkler)"},{value:"levenshtein",label:"Character edits (Levenshtein)"},{value:"damerau",label:"Edits and swapped letters (Damerau–Levenshtein)"},{value:"token-set",label:"Same words, extra words allowed (token set)"},{value:"token-sort",label:"Same words, any order (token sort)"},{value:"dice",label:"Letter pairs (Sørensen–Dice)"},{value:"jaccard",label:"Shared words (Jaccard)"},{value:"ratcliff",label:"Common runs of text (Ratcliff–Obershelp)"},{value:"lcs",label:"Letters in order (longest common subsequence)"},{value:"soundex",label:"Sounds alike (Soundex)"}],hint:"Best overall averages Jaro–Winkler, token set and letter pairs, and shows each score in Breakdown."},{key:"threshold",label:"Minimum score",type:"number",default:0,hint:"From 0 to 1. When the best score is lower, Match is empty and Matched is false."},{key:"limit",label:"Ranked entries",type:"number",default:5,hint:"How many of the closest entries Ranked lists (1–100)."},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!0,hint:"Treat upper and lower case as the same."},{key:"ignoreAccents",label:"Ignore accents",type:"boolean",default:!0,hint:"Treat é as e and ü as u."},{key:"ignorePunctuation",label:"Ignore punctuation",type:"boolean",default:!0,hint:"Treat punctuation and symbols as spaces: “Acme, Inc.” matches “Acme Inc”."},{key:"ignoreStopWords",label:"Ignore connecting words",type:"boolean",default:!1,hint:"Skip stop words such as the, a, of and and, so “The Bank of America” matches “Bank America”."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"ignoreStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"match",label:"Match"},{key:"score",label:"Score"},{key:"index",label:"Position"},{key:"matched",label:"Matched"},{key:"method",label:"Method"},{key:"ranked",label:"Ranked"}]),We("diff","Find differences",["diff","changes","compare","delta","patch","unified diff","what changed","version"],[{key:"a",label:"Original",type:"string",config:{multiline:!0},default:""},{key:"b",label:"Changed",type:"string",config:{multiline:!0},default:""},{key:"by",label:"Compare by",type:"select",default:"lines",options:[{value:"lines",label:"Lines"},{value:"words",label:"Words"}]},{key:"ignoreCase",label:"Ignore case",type:"boolean",default:!1,hint:"Treat upper and lower case as the same."},{key:"ignoreWhitespace",label:"Ignore spacing",type:"boolean",default:!1,hint:"Treat runs of spaces as one and ignore spaces at the ends of lines."}],[{key:"changed",label:"Changed"},{key:"added",label:"Added"},{key:"removed",label:"Removed"},{key:"unchanged",label:"Unchanged"},{key:"changes",label:"Changes"},{key:"unified",label:"Unified diff"}]),We("change-case","Change case",["case","uppercase","lowercase","capitalize","title case","camel case","pascal case","snake case","kebab case","slug","slugify","permalink"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"to",label:"Change to",type:"select",default:"lower",options:[{value:"lower",label:"lower case"},{value:"upper",label:"UPPER CASE"},{value:"title",label:"Title Case"},{value:"sentence",label:"Sentence case"},{value:"camel",label:"camelCase"},{value:"pascal",label:"PascalCase"},{value:"snake",label:"snake_case"},{value:"kebab",label:"kebab-case"},{value:"constant",label:"CONSTANT_CASE"},{value:"slug",label:"url-slug"}]}],[{key:"result",label:"Result"}]),We("normalize","Clean up",["normalize","clean","sanitize","trim","strip","accents","diacritics","punctuation","whitespace","stop words","canonical"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"lowercase",label:"Lower case",type:"boolean",default:!0},{key:"removeAccents",label:"Remove accents",type:"boolean",default:!0,hint:"é becomes e, ü becomes u."},{key:"removePunctuation",label:"Remove punctuation",type:"boolean",default:!1,hint:"Replace punctuation and symbols with spaces."},{key:"collapseWhitespace",label:"Tidy spaces",type:"boolean",default:!0,hint:"Trim the ends and turn runs of spaces, tabs and newlines into one space."},{key:"removeStopWords",label:"Remove connecting words",type:"boolean",default:!1,hint:"Drop stop words such as the, a, of and and."},{key:"language",label:"Stop-word language",type:"select",default:"en",options:[{value:"en",label:"English"}],showIf:{field:"removeStopWords",equals:!0},hint:"Which list of connecting words to skip. English for now."}],[{key:"result",label:"Result"}]),We("truncate","Shorten",["truncate","shorten","limit","excerpt","ellipsis","max length","sms","preview"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"length",label:"Length",type:"number",default:100,hint:"The longest result in characters, ending included — or, by words, how many words to keep."},{key:"unit",label:"Count",type:"select",default:"characters",options:[{value:"characters",label:"Characters"},{value:"words",label:"Words"}]},{key:"ending",label:"Ending",type:"string",default:"…",hint:"Added only when the text is cut. Leave empty for none."},{key:"keepWholeWords",label:"Keep whole words",type:"boolean",default:!0,showIf:{field:"unit",equals:"characters"},hint:"Cut after the last whole word that fits."}],[{key:"result",label:"Result"},{key:"truncated",label:"Was shortened"}]),We("mask","Mask sensitive data",["mask","redact","anonymize","pii","gdpr","hide","obfuscate","credit card","luhn","privacy"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."},{key:"emails",label:"Email addresses",type:"boolean",default:!0,hint:"Keeps the first letter and the domain: j***@acme.io."},{key:"phones",label:"Phone numbers",type:"boolean",default:!0},{key:"cardNumbers",label:"Card numbers",type:"boolean",default:!0,hint:"Only numbers that pass the card checksum (Luhn)."},{key:"pattern",label:"Also mask (regex)",type:"string",default:"",hint:"Optional regular expression for anything else to hide, such as an order reference."},{key:"keepLast",label:"Keep last",type:"number",default:4,hint:"Letters and digits left visible at the end of each phone, card or pattern match — never more than half of them."},{key:"maskWith",label:"Mask character",type:"string",default:"*"}],[{key:"result",label:"Result"},{key:"count",label:"Masked"}]),We("count","Count",["count","length","word count","character count","chars","bytes","size","lines"],[{key:"text",label:"Text",type:"string",config:{multiline:!0},default:"",hint:"The text to work on. Empty text is allowed."}],[{key:"characters",label:"Characters"},{key:"words",label:"Words"},{key:"sentences",label:"Sentences"},{key:"lines",label:"Lines"},{key:"paragraphs",label:"Paragraphs"},{key:"bytes",label:"Bytes"}])],Uc='<path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" />',He=(e,t,s,o,a)=>({app:oc,action:e,label:t,displayName:"Number",groupActions:!0,group:"compute",icon:Uc,keywords:s,params:o,output:a}),Bc=[He("calculate","Calculate",["calculate","calculator","math","arithmetic","add","plus","sum","subtract","minus","multiply","times","divide","division","remainder","modulo","mod","power","exponent","min","max","average","mean"],[{key:"a",label:"First number",type:"number",required:!0},{key:"operation",label:"Operation",type:"select",default:"add",options:[{value:"add",label:"Add (+)"},{value:"subtract",label:"Subtract (−)"},{value:"multiply",label:"Multiply (×)"},{value:"divide",label:"Divide (÷)"},{value:"remainder",label:"Remainder (modulo)"},{value:"power",label:"Power (^)"},{value:"min",label:"Smaller of the two (min)"},{value:"max",label:"Larger of the two (max)"},{value:"average",label:"Average of the two"}]},{key:"b",label:"Second number",type:"number",required:!0}],[{key:"result",label:"Result"}]),He("increment","Increment",["counter","increment","decrement","++","--","step","page number","count up","count down","index","loop","wrap around","round robin"],[{key:"value",label:"Number",type:"number",default:0,hint:"The current value, such as {{ steps.page.output.result }}. Counts within this run only: for a counter that persists across runs, use Store → Increment counter."},{key:"by",label:"Step",type:"number",default:1,hint:"Added to the number. Use a negative step to count down."},{key:"min",label:"Minimum",type:"number",hint:"Optional lowest allowed value."},{key:"max",label:"Maximum",type:"number",hint:"Optional highest allowed value."},{key:"atLimit",label:"Past the limit",type:"select",default:"clamp",options:[{value:"clamp",label:"Stop at the limit"},{value:"wrap",label:"Wrap around"},{value:"refuse",label:"Fail the step"}],hint:"What happens when the step would pass Minimum or Maximum. Used only when one of them is set; Wrap around needs both."}],[{key:"result",label:"Result"},{key:"previous",label:"Previous"},{key:"hitLimit",label:"Hit the limit"}]),He("formula","Formula",["formula","expression","equation","evaluate","eval","calculate","math","arithmetic","variables","excel formula","spreadsheet","sqrt","abs"],[{key:"formula",label:"Formula",type:"string",required:!0,placeholder:"(price * qty) * (1 - discount)",hint:"+ - * / % (remainder) and ^ (power), parentheses, and min, max, abs, round, floor, ceil, sqrt. Names come from Variables."},{key:"variables",label:"Variables",type:"json",hint:'The names the formula uses and their numbers, such as { "price": 19.99, "qty": 3, "discount": 0.1 }.'}],[{key:"result",label:"Result"}]),He("clamp","Keep in range",["clamp","range","limit","bound","bounds","between","constrain","min","max","cap","floor"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"min",label:"Minimum",type:"number",required:!0},{key:"max",label:"Maximum",type:"number",required:!0}],[{key:"result",label:"Result"},{key:"clamped",label:"Was changed"}]),He("round","Round number",["round","rounding","decimal places","decimals","precision","floor","ceil","ceiling","truncate","trunc","half even","banker's rounding","nearest","tofixed","step"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"mode",label:"Round",type:"select",default:"round",options:[{value:"round",label:"Nearest"},{value:"half-even",label:"Nearest, ties to even (banker's)"},{value:"floor",label:"Down (floor)"},{value:"ceil",label:"Up (ceiling)"},{value:"truncate",label:"Toward zero (truncate)"}],hint:"Nearest rounds a tie away from zero: 2.5 becomes 3 and −2.5 becomes −3."},{key:"to",label:"Round to",type:"select",default:"decimals",options:[{value:"decimals",label:"Decimal places"},{value:"step",label:"A step, such as 0.05"}]},{key:"decimals",label:"Decimal places",type:"number",default:2,showIf:{field:"to",equals:"decimals"},hint:"From 0 to 15."},{key:"step",label:"Step",type:"number",default:.05,showIf:{field:"to",equals:"step"},hint:"Round to a multiple of this, such as 0.05 (nickels), 0.25 or 5."}],[{key:"result",label:"Result"}]),He("format","Format number",["format","currency","money","price","percent","percentage","compact","thousands separator","locale","intl","numberformat","tolocalestring","unit","pretty"],[{key:"value",label:"Number",type:"number",required:!0,hint:'The number to work on. Text such as "12.5" is read as a number.'},{key:"style",label:"Style",type:"select",default:"decimal",options:[{value:"decimal",label:"Number (1,234.5)"},{value:"currency",label:"Currency ($1,234.50)"},{value:"percent",label:"Percent (0.12 → 12%)"},{value:"compact",label:"Compact (1.2K)"},{value:"unit",label:"With a unit (12 km)"}]},{key:"locale",label:"Locale",type:"string",default:"en-US",hint:"A language tag that decides separators and symbols, such as en-US, de-DE or fr-FR."},{key:"currency",label:"Currency",type:"string",default:"USD",showIf:{field:"style",equals:"currency"},hint:"A three-letter ISO 4217 code, such as USD, EUR or JPY."},{key:"unit",label:"Unit",type:"string",default:"",showIf:{field:"style",equals:"unit"},hint:"A unit such as kilometer, kilogram, liter, megabyte, percent or kilometer-per-hour."},{key:"minDecimals",label:"Fewest decimals",type:"number",hint:"Optional, from 0 to 20. Pads with zeros: 2 shows 5 as 5.00."},{key:"maxDecimals",label:"Most decimals",type:"number",hint:"Optional, from 0 to 20. Rounds to this many."},{key:"prefix",label:"Before",type:"string",default:"",hint:"Optional text placed before the number."},{key:"suffix",label:"After",type:"string",default:"",hint:'Optional text placed after the number, such as " per month".'}],[{key:"result",label:"Result"}]),He("parse","Read a number from text",["parse","parsefloat","parseint","to number","string to number","convert","cast","extract number","currency","money","percent","locale","decimal separator"],[{key:"text",label:"Text",type:"string",default:"",hint:"The text to read, such as a price from a web page or a CSV cell."},{key:"locale",label:"Locale",type:"string",default:"en-US",hint:"Decides the decimal and thousands separators: en-US reads 1,234.56 and de-DE reads 1.234,56."},{key:"percentAsFraction",label:"Percent as a fraction",type:"boolean",default:!0,hint:"Read 12% as 0.12. Turn off to read it as 12."},{key:"allowSuffixes",label:"Read K, M, B and T",type:"boolean",default:!0,hint:"Read 1.2K as 1200, 3M as 3000000, 2B (or 2bn) as 2000000000 and 1T as a trillion."}],[{key:"result",label:"Result"},{key:"found",label:"Found"}]),He("percent-change","Percent change",["percent change","percentage change","growth","growth rate","delta","difference","increase","decrease","change","yoy","mom","trend"],[{key:"from",label:"From",type:"number",required:!0,hint:"The earlier or baseline number."},{key:"to",label:"To",type:"number",required:!0,hint:"The later number."}],[{key:"change",label:"Change"},{key:"percent",label:"Percent"},{key:"direction",label:"Direction"}]),He("allocate","Split an amount",["split","allocate","allocation","distribute","divide","share","pro rata","prorate","installments","largest remainder","cents","bill split","ratio"],[{key:"amount",label:"Amount",type:"number",required:!0},{key:"parts",label:"Equal parts",type:"number",hint:"How many equal parts, from 1 to 10,000. Leave empty to split by Ratios instead."},{key:"ratios",label:"Ratios",type:"json",hint:"Instead of equal parts, a list of shares such as [50, 30, 20] or [1, 2]."},{key:"decimals",label:"Decimal places",type:"number",default:2,hint:"The smallest unit, from 0 to 10: 2 splits into cents."}],[{key:"parts",label:"Parts"}]),He("describe","Statistics",["statistics","stats","describe","summary","mean","average","median","mode","standard deviation","stddev","variance","percentile","quantile","p95","p99","min","max","sum"],[{key:"values",label:"Numbers",type:"json",required:!0,hint:"A list of numbers, such as {{ steps.orders.output.totals }}. Entries that are not numbers are skipped and counted."},{key:"percentiles",label:"Percentiles",type:"json",default:[50,90,95,99],hint:"Which percentiles to return, from 0 to 100. Linear interpolation between values (the spreadsheet PERCENTILE.INC and NumPy default)."}],[{key:"count",label:"Count"},{key:"skipped",label:"Skipped"},{key:"sum",label:"Sum"},{key:"mean",label:"Mean"},{key:"median",label:"Median"},{key:"mode",label:"Mode"},{key:"min",label:"Min"},{key:"max",label:"Max"},{key:"range",label:"Range"},{key:"variance",label:"Variance"},{key:"sampleVariance",label:"Sample variance"},{key:"stddev",label:"Standard deviation"},{key:"sampleStddev",label:"Sample standard deviation"},{key:"percentiles",label:"Percentiles"}]),He("random","Random number",["random","random number","random integer","rand","rng","dice","roll","lottery","pick","uniform","sample"],[{key:"min",label:"Minimum",type:"number",default:0},{key:"max",label:"Maximum",type:"number",default:100},{key:"integer",label:"Whole number",type:"boolean",default:!0},{key:"decimals",label:"Decimal places",type:"number",default:2,showIf:{field:"integer",equals:!1},hint:"From 0 to 15."}],[{key:"result",label:"Result"}])],ba={key:"onMax",type:"select",label:"When the limit is reached",default:"fail",hint:"Fail the step, or stop looping and continue the workflow with what was collected.",options:[{value:"fail",label:"Fail the step"},{value:"stop",label:"Stop and continue the workflow"}]},wt=[...Wc,...Bc,...Rc,...Ic,...Fc,...Lc,...Dc,{app:Xt,action:"race",label:"Race",displayName:"Race",group:"control",icon:'<path d="M3 5h4l5 7h9M3 19h4l5-7" /><polyline points="17 8 21 12 17 16" />',ports:{in:"many",out:1},params:[]},{app:nt,action:"route",label:"Router",displayName:"Router",group:"control",icon:ca,params:[{key:"routes",label:"Routes",type:"json",required:!0,default:[{id:"route_1",label:"Route 1",condition:!1},{id:"default",label:"Default",default:!0}]}],output:[{key:"route",label:"Selected route"}]},{app:no,action:"stop",label:"Stop workflow",displayName:"Stop workflow",group:"control",icon:'<rect x="5" y="5" width="14" height="14" rx="2" />',params:[{key:"condition",label:"Condition",type:"json",default:!0,hint:"Stop when this condition is true. Omit it to always stop."},{key:"outcome",label:"Outcome",type:"select",default:"success",hint:"Success: end the run as succeeded. Error: fail this step with the message below, so error paths and the workflow error handler run.",options:[{value:"success",label:"Success"},{value:"error",label:"Error"}]},{key:"message",label:"Error message",type:"string",default:"Stopped by workflow",hint:"Shown as the step's error when the condition holds.",showIf:{field:"outcome",equals:"error"}}],output:[{key:"stopped",label:"Stopped"}]},{app:Yt,action:"manual",label:"Manual trigger",displayName:"Manual trigger",group:"trigger",icon:wc,ports:{in:0,out:1},params:[{key:"fields",label:"Fields",type:"array",default:[],hint:"The fields this trigger emits into the run. Reference them downstream as {{ nodes.<trigger>.output.<key> }}.",item:{type:"object",fields:[{key:"key",label:"Key",type:"string",placeholder:"e.g. email"},{key:"type",label:"Type",type:"select",default:"string",options:[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"boolean",label:"Boolean"},{value:"json",label:"JSON"}]},{key:"default",label:"Default",type:"string",placeholder:"optional",config:{valueTypeFrom:"type"}},{key:"required",label:"Required",type:"boolean",default:!1}]}}]},{app:Ke,action:"webhook",label:"Webhook",displayName:"Webhook",group:"trigger",icon:jc,ports:{in:0,out:1},params:[{key:"methods",label:"HTTP Methods",type:"multiselect",required:!0,default:["POST"],hint:"Which HTTP methods this webhook accepts.",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"PATCH",label:"PATCH"},{value:"DELETE",label:"DELETE"},{value:"HEAD",label:"HEAD"}]},{key:"auth",label:"Authentication",type:"select",default:"none",hint:"How incoming requests are authenticated.",options:[{value:"none",label:"None"},{value:"basic",label:"Basic auth"},{value:"header",label:"Header auth"},{value:"jwt",label:"JWT (HMAC)"}]},{key:"basicUser",label:"Username",type:"string",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"basicPassword",label:"Password",type:"secret",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"headerName",label:"Header name",type:"string",row:"header-auth",placeholder:"e.g. X-Api-Key",showIf:{field:"auth",equals:"header"}},{key:"headerValue",label:"Header value",type:"secret",row:"header-auth",showIf:{field:"auth",equals:"header"}},{key:"jwtSecret",label:"JWT secret",type:"secret",showIf:{field:"auth",equals:"jwt"}},{key:"responseMode",label:"Respond",type:"select",default:"onReceived",hint:"When and how to respond to the caller.",options:[{value:"onReceived",label:"Immediately (ASAP)"},{value:"lastNode",label:"When the run finishes"},{value:"responseNode",label:"Using a Response node"},{value:"streaming",label:"Streaming"}]},{key:"responseCode",label:"Response status code",type:"number",default:200,showIf:{field:"responseMode",notIn:["responseNode"]}},{key:"responseData",label:"Response body (immediate)",type:"text",hint:'Body for "Immediately" responses. Empty = { "runId": "run_…", "status": "started" }. Write {{ runId }} to include the run id.',showIf:{field:"responseMode",equals:"onReceived"}},{key:"rawBody",label:"Raw body",type:"boolean",default:!1,advanced:!0},{key:"ignoreBots",label:"Ignore bots",type:"boolean",default:!1,advanced:!0},{key:"ipAllowList",label:"IP allow list",type:"array",advanced:!0,item:{type:"string",placeholder:"e.g. 203.0.113.4"},hint:"Client IPs allowed to call this webhook. Empty = allow all."},{key:"binaryPropertyName",label:"Binary field name",type:"string",advanced:!0},{key:"cors",label:"CORS allowed origin",type:"string",advanced:!0},{key:"responseHeaders",label:"Response headers",type:"array",default:[],advanced:!0,item:{type:"object",fields:[{key:"name",label:"Name",type:"string"},{key:"value",label:"Value",type:"string"}]}}]},{app:mt,action:"submission",label:"Form",displayName:"On form submission",group:"trigger",icon:Nc,ports:{in:1,out:1},params:[{key:"form",label:"Form",type:"json",ui:"form-builder",whole:!0,default:wr(),hint:"The form's title, fields, pages and completion screen."},{key:"responseMode",label:"After submit",type:"select",default:"onSubmit",hint:"When the submitter sees the completion screen.",options:[{value:"onSubmit",label:"Show completion screen immediately"},{value:"lastNode",label:"Wait for the workflow to finish"},{value:"responseNode",label:"Using a Respond to Webhook step"}]},{key:"auth",label:"Authentication",type:"select",default:"none",hint:"Who may open and submit the form.",options:[{value:"none",label:"Anyone with the link"},{value:"basic",label:"Basic auth (username and password)"}]},{key:"basicUser",label:"Username",type:"string",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"basicPassword",label:"Password",type:"secret",row:"basic-auth",showIf:{field:"auth",equals:"basic"}},{key:"ignoreBots",label:"Ignore bots",type:"boolean",default:!0,advanced:!0,hint:"Silently drop submissions from crawlers and link previewers."}]},{app:eo,action:"schedule",label:"Schedule",displayName:"Scheduler",group:"trigger",icon:xc,ports:{in:0,out:1},params:[{key:"mode",label:"Mode",type:"select",required:!0,default:"cron",hint:"How the schedule fires.",options:[{value:"once",label:"Once"},{value:"cron",label:"Cron"},{value:"interval",label:"Interval"}]},{key:"cron",label:"Cron expression",type:"string",placeholder:"e.g. 0 9 * * 1-5",showIf:{field:"mode",equals:"cron"}},{key:"runAt",label:"Run at",type:"string",placeholder:"e.g. 2026-01-01T09:00:00Z",showIf:{field:"mode",equals:"once"}},{key:"intervalSeconds",label:"Interval (seconds)",type:"number",showIf:{field:"mode",equals:"interval"}},{key:"timezone",label:"Timezone",type:"string",default:"UTC",advanced:!0}]},{app:Se,action:"if",label:"If",displayName:"If",group:"control",icon:ca,params:[{key:"condition",type:"json",label:"Condition",required:!0,default:!0,hint:"A boolean, or an expression like {{ nodes.x.output.ok }}."}]},{app:Se,action:"foreach",label:"For each",displayName:"For each",group:"control",icon:bc,params:[{key:"items",type:"json",label:"Items",required:!0,whole:!0,hint:"An array to iterate, or an expression binding to one."},{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per item. The canvas owns it; the engine requires it at run time."},{key:"parallelism",type:"number",label:"Parallelism",hidden:!0,hint:"Concurrent iterations. The engine clamps it to 1."}]},{app:Se,action:"while",label:"Repeat",displayName:"Repeat",group:"control",icon:ua,keywords:["while","loop","until","poll","retry","do while"],params:[{key:"maxIterations",type:"number",label:"Max passes",default:200,hint:"Stop after this many passes (1 to 10,000). The safety stop against a loop that never ends."},ba,{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per pass, ending with the Repeat? step. The canvas owns it; the engine requires it at run time."}],output:[{key:"iterations",label:"Passes run"},{key:"reachedMax",label:"Reached the limit"},{key:"last",label:"Last Repeat? decision"}]},{app:Se,action:"while-end",label:"Repeat?",displayName:"Repeat?",group:"control",icon:ua,hidden:!0,params:[{key:"continue",type:"json",label:"Repeat again",required:!0,whole:!0,default:!1,hint:"true runs another pass; false ends the loop. A boolean, or an expression such as {{ steps.poll.output.body.status != 'done' }}."}],output:[{key:"continue",label:"Repeat again"}]},{app:Se,action:"paginate",label:"Paginate",displayName:"Paginate",group:"control",icon:da,keywords:["pages","pagination","cursor","offset","next page","loop"],params:[{key:"start",type:"number",label:"First page",default:1,hint:"The first page number, read as loop.page. Use 0 for an API that takes an offset."},{key:"increment",type:"number",label:"Increment",default:1,hint:"Added to loop.page after each page: 1 for page numbers, the page size for offsets. May not be 0."},{key:"maxIterations",type:"number",label:"Max pages",default:200,hint:"Stop after this many pages (1 to 10,000). The safety stop against a loop that never ends."},ba,{key:"body",type:"json",label:"Body",hidden:!0,hint:"Step ids run per page, ending with the Next page step. The canvas owns it; the engine requires it at run time."}],output:[{key:"pages",label:"Pages fetched"},{key:"reachedMax",label:"Reached the limit"},{key:"items",label:"All items"},{key:"continuation",label:"Last continuation"},{key:"meta",label:"Last meta"}]},{app:Se,action:"paginate-end",label:"Next page",displayName:"Next page",group:"control",icon:da,hidden:!0,params:[{key:"hasMore",type:"json",label:"Has more",required:!0,whole:!0,hint:"true fetches another page; false ends the loop. A boolean, or an expression such as {{ steps.fetch.output.body.has_more }}."},{key:"continuation",type:"string",label:"Continuation",hint:"A cursor or token for the next request, read there as loop.continuation. Empty means none."},{key:"meta",type:"json",label:"Meta",whole:!0,hint:"Any object to hand to the next pass, read there as loop.meta."},{key:"items",type:"json",label:"Items",whole:!0,hint:"This page's records (a list). Every page's items are collected into the Paginate step's items."}],output:[{key:"hasMore",label:"Has more"},{key:"continuation",label:"Continuation"},{key:"meta",label:"Meta"},{key:"items",label:"Items"}]},{app:Se,action:"parallel",label:"Parallel",displayName:"Parallel",group:"control",icon:yc,params:[]},{app:Se,action:"wait",label:"Wait",displayName:"Wait",group:"control",icon:gc,params:[{key:"duration",type:"string",label:"Duration",default:"1s",hint:"Use 30s, 1h30m30s, or 3d30s. Units: w, d, h, m, s; uppercase also works."}]},{app:xr,action:"run",label:"Run script",displayName:"Run script",group:"compute",icon:vc,params:[{key:"language",label:"Language",type:"select",default:"javascript",options:[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"}],hint:"Execution language for this step's code. TypeScript types are erased before it runs, not checked. Python runs CPython-on-WASM with no network."},{key:"code",type:"code",label:"Script",required:!0,scriptReads:!0,default:`// Runs as a function body. Return the step's output.
|
|
3
3
|
return input;`,hint:"Return the step's output. Read data from state, vars and consts; {{ }} isn't substituted in code. digest(value) returns a stable SHA-256 hex (await it in JavaScript or TypeScript)."},{key:"custom_input",type:"section",section:"collapsible",title:"Custom input (advanced)",openWhenSet:!0,children:[{key:"input",type:"json",label:"Input",whole:!0,hint:"Replaces what the script reads as `input` (by default, the run state). Each bound value keeps its type; a secret goes here, since state never holds one."}]}]},{app:nc,action:"render",label:"Render template",displayName:"Template",group:"compute",icon:Tc,output:[{key:"result"}],params:[{key:"template",label:"Template",type:"json",required:!0,whole:!0,hint:'Enter a JSON string ("Hello {{name}}") or object, or bind one with ƒx. String values render recursively; other values stay unchanged. {{name}} is HTML-escaped; use {{{name}}} for raw output.'},{key:"values",label:"Values",type:"vars",required:!0,whole:!0,default:{},hint:"Enter a JSON object, or use ƒx to bind data from workflow state or variables. Each key becomes a top-level placeholder root."}]},{app:fn,action:"set",label:"Data",displayName:"Data set",group:"compute",icon:pa,params:[{key:"vars",type:"vars",label:"Variables",required:!0,default:[],hint:"Set values for downstream steps using individual fields or a JSON object."}]},{app:fn,action:"update",label:"Update object",displayName:"Update object",group:"compute",icon:pa,params:[{key:"object",type:"json",label:"Starting object",required:!0,whole:!0,hint:"Use ƒx to choose an object from state or a previous step. The original stays unchanged."},{key:"vars",type:"vars",label:"Fields to set",required:!0,default:[],hint:"Set one or more fields. Use dot paths for nested fields, such as address.city."}]},{app:ec,action:"request",label:"HTTP request",displayName:"HTTP",group:"request",icon:kc,output:[{key:"status",label:"Status code"},{key:"statusText",label:"Status text"},{key:"ok",label:"Succeeded (2xx)"},{key:"headers",label:"Response headers"},{key:"body",label:"Response body"},{key:"pages",label:"Pages fetched (pagination only)"},{key:"items",label:"All items (pagination only)"}],params:[{key:"method",type:"string",label:"Method",required:!0,default:"GET",options:[{value:"GET",label:"GET"},{value:"HEAD",label:"HEAD"},{value:"OPTIONS",label:"OPTIONS"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"PATCH",label:"PATCH"},{value:"DELETE",label:"DELETE"}],hint:"HTTP method for the request."},{key:"url",type:"string",label:"URL",required:!0,default:"",hint:"Full request URL, e.g. https://api.example.com/v1/things."},{key:"headers",type:"json",label:"Headers",default:{},hint:"Object of header name → value."},{key:"query",type:"json",label:"Query params",default:{},hint:"Object of query-string name → value, merged into the URL."},{key:"body",type:"text",label:"Body",default:"",hint:"Request body: raw text, a JSON string, or a file from an earlier step. Ignored for GET/HEAD."},{key:"responseType",label:"Response type",type:"select",default:"text",hint:"Text (default): decode the response as text, parsing it as JSON when the response says it is. File: store the raw response bytes and return a file reference instead of decoding them — use this for a non-text response (e.g. a PDF or image); decoding it as text would corrupt the bytes.",options:[{value:"text",label:"Text"},{value:"file",label:"File"}]},{key:"pagination",label:"Pagination",type:"select",default:"off",hint:"Fetch several pages and collect their items. Off (default): one request. Every page reuses this request's method, headers and body, and never leaves this URL's host.",options:[{value:"off",label:"Off"},{value:"next_url",label:"Next URL in the body"},{value:"link_header",label:"Link header (rel=next)"},{value:"page",label:"Page number"},{value:"offset",label:"Offset"},{value:"cursor",label:"Cursor"}]},{key:"itemsPath",label:"Items path",type:"string",placeholder:"e.g. data.items",hint:"Path to the list of items in each page's body. Leave empty when the body itself is the list.",showIf:{field:"pagination",notIn:["off"]}},{key:"maxPages",label:"Max pages",type:"number",default:10,hint:"Stop after this many requests (at most 100).",showIf:{field:"pagination",notIn:["off"]}},{key:"nextUrlPath",label:"Next URL path",type:"string",placeholder:"e.g. links.next",hint:"Path to the next page's URL in the body. Pagination stops when it is empty.",showIf:{field:"pagination",equals:"next_url"}},{key:"pageParam",label:"Page parameter",type:"string",default:"page",hint:"Query parameter that carries the page number.",showIf:{field:"pagination",equals:"page"}},{key:"pageStart",label:"First page",type:"number",default:1,hint:"Page number of the first request. Each next page adds 1.",showIf:{field:"pagination",equals:"page"}},{key:"offsetParam",label:"Offset parameter",type:"string",default:"offset",hint:"Query parameter that carries the offset. It starts at 0 and grows by the number of items received.",showIf:{field:"pagination",equals:"offset"}},{key:"limitParam",label:"Limit parameter",type:"string",placeholder:"e.g. limit",hint:"Optional query parameter that carries the page size.",showIf:{field:"pagination",equals:"offset"}},{key:"limitValue",label:"Limit value",type:"number",hint:"Page size sent in the limit parameter.",showIf:{field:"pagination",equals:"offset"}},{key:"cursorParam",label:"Cursor parameter",type:"string",placeholder:"e.g. cursor",hint:"Query parameter that carries the cursor on the next request.",showIf:{field:"pagination",equals:"cursor"}},{key:"cursorPath",label:"Cursor path",type:"string",placeholder:"e.g. meta.next_cursor",hint:"Path to the next cursor in the body. Pagination stops when it is empty.",showIf:{field:"pagination",equals:"cursor"}}]},{app:tc,action:"respond",label:"Respond to Webhook",displayName:"Respond to Webhook",group:"request",icon:Sc,params:[{key:"respondWith",label:"Respond with",type:"select",default:"json",hint:"Shape of the response returned to the webhook caller.",options:[{value:"json",label:"JSON"},{value:"text",label:"Text"},{value:"noData",label:"No body"}]},{key:"responseCode",label:"Response status code",type:"number",default:200},{key:"responseBody",label:"Response body",type:"json",default:{},hint:"Body to return (object for JSON, string for Text)."},{key:"responseHeaders",label:"Response headers",type:"array",default:[],item:{type:"object",fields:[{key:"name",label:"Name",type:"string"},{key:"value",label:"Value",type:"string"}]}}]},{app:Se,action:"aggregate",label:"Aggregate",displayName:"Aggregate",group:"control",icon:fa,hidden:!0,ports:{in:10,out:1},params:[{key:"mode",label:"Mode",type:"select",default:"array",hint:"How to combine the inbound branch outputs: an array of results, or an object keyed by source step.",options:[{value:"array",label:"Array"},{value:"object",label:"Object"}]}]},{app:Se,action:"merge",label:"Merge",displayName:"Merge",group:"control",icon:fa,ports:{in:"many",out:1},params:[{key:"mode",label:"Mode",type:"select",default:"array",hint:"Combine the entries into an array, or into an object keyed by each entry's key.",options:[{value:"array",label:"Array"},{value:"object",label:"Object"}]},{key:"entries",label:"Entries",type:"array",default:[],hint:"Each entry's value may be an expression (ƒx) over the inbound branches' outputs.",item:{type:"object",fields:[{key:"key",label:"Key",type:"string"},{key:"value",label:"Value",type:"string"}]}}]},{app:jn,action:"call",label:"Call workflow",displayName:"Call",group:"compute",icon:Cc,ports:{in:1,out:1},params:[{key:"targetKind",label:"Target kind",type:"select",required:!0,default:"workflow",hint:"Whether this node calls another Workflow or a Function.",options:[{value:"workflow",label:"Workflow"},{value:"function",label:"Function"}]},{key:"targetId",label:"Target id",type:"string",required:!0,default:"",placeholder:"e.g. wf_… or fn_…",hint:"Id of the Workflow (wf_…) or Function (fn_…) to call, within this project."},{key:"entry",label:"Trigger node",type:"string",hint:"The manual trigger node to start at in the called workflow."},{key:"inputs",label:"Inputs",type:"json",default:{},hint:"Payload passed to the target — an object keyed by the callee's declared inputs. Values may be expressions."},{key:"wait",label:"Wait for completion",type:"boolean",default:!0,hint:"On: block until the sub-run finishes and expose its output. Off: return a run handle and continue."}]},{app:to,action:"get",label:"Get document",displayName:"Document",group:"compute",icon:Ac,ports:{in:1,out:1},params:[{key:"key",label:"Key",type:"string",required:!0,default:"",hint:"Document key to read — may be an expression, e.g. a step output."}]},{app:Tn,action:"complete",label:"Complete with model",displayName:"Model",group:"compute",icon:ys,ports:{in:1,out:1},params:[{key:"route",label:"Route",type:"model-route",hint:"Name of a model route (Models → Routes). Use this, or the model + connection pair below — never both."},{key:"model",label:"Model",type:"string",advanced:!0,hint:"Catalog id of a model (`mdl_…`, Models → Catalog), called through `connection`. Ignored when `route` is set."},{key:"connection",label:"Connection",type:"string",advanced:!0,hint:"Id of a model-provider connection on this account. Required by `model`; ignored when `route` is set."},{key:"input",label:"Input",type:"json",required:!0,default:{},hint:`The request body handed to the provider — e.g. { "messages": [{ "role": "user", "content": "hi" }] }, or the provider's native payload.`},{key:"dialect",label:"Dialect",type:"select",advanced:!0,hint:"Rewrite the result into this wire dialect; bridge keeps the baseline unprojected. Leave unset to keep the provider's own.",placeholder:"Provider native",options:[{value:"bridge",label:"Bridge (unprojected)"},{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"ollama",label:"Ollama"}]},{key:"response",label:"Response",type:"select",advanced:!0,hint:"Output: the dialect-shaped result. Raw: the provider's own response. Leave unset to carry both.",placeholder:"Both",options:[{value:"output",label:"Output"},{value:"raw",label:"Raw"}]}]},{app:Tn,action:"agent",label:"Run agent",displayName:"Agent",group:"compute",icon:Ec,ports:{in:1,out:1},params:[{key:"agent",label:"Agent",type:"agent",required:!0,hint:"An agent from the Agents dashboard. Its tools run when it calls them."},{key:"message",label:"Message",type:"text",required:!0,hint:"What to tell the agent — text, or an expression such as an earlier step's output (an object is sent as JSON)."}]},{app:Tn,action:"list-models",label:"List models",displayName:"Model",group:"compute",icon:ys,ports:{in:1,out:1},params:[{key:"connection",label:"Connection",type:"string",required:!0,hint:"Connection id of the provider to list models for."}]},{app:Tn,action:"allowance",label:"Model allowance",displayName:"Model",group:"compute",icon:ys,ports:{in:1,out:1},params:[{key:"connection",label:"Connection",type:"string",required:!0,hint:"Connection id of the provider to read the allowance of."}]},{app:Je,action:"get",label:"Get entry",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"key",label:"Key",type:"data-store-key",required:!0,hint:"Entry key — search the store's entries, type a key, or bind an expression."},{key:"required",label:"Required",type:"boolean",default:!1,hint:"Fail the step when the key is missing instead of returning found: false."}],output:[{key:"found"},{key:"key"},{key:"value"},{key:"version"},{key:"expiresAt"}]},{app:Je,action:"set",label:"Set entry",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"key",label:"Key",type:"data-store-key",required:!0,hint:"Entry key — search the store's entries, type a key, or bind an expression."},{key:"value",label:"Value",type:"json",required:!0,hint:"The JSON value to store."},{key:"ifVersion",label:"If version",type:"number",hint:"Write only when the stored version equals this number."},{key:"ttlSeconds",label:"TTL (seconds)",type:"number",hint:"Expire the entry after this many seconds. Omit to keep it."}],output:[{key:"key"},{key:"value"},{key:"version"},{key:"expiresAt"}]},{app:Je,action:"update",label:"Update entry",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"key",label:"Key",type:"data-store-key",required:!0,hint:"Entry key. The entry must already exist and hold an object."},{key:"fields",label:"Fields",type:"json",required:!0,hint:"Object of field → new value. Listed fields are replaced; the others are kept."},{key:"ifVersion",label:"If version",type:"number",hint:"Write only when the stored version equals this number. Omit to fail only if someone else changes the entry while this step runs."}]},{app:Je,action:"delete",label:"Delete entry",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"key",label:"Key",type:"data-store-key",required:!0,hint:"Entry key — search the store's entries, type a key, or bind an expression."}],output:[{key:"key"},{key:"deleted"}]},{app:Je,action:"increment",label:"Increment counter",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"key",label:"Key",type:"data-store-key",required:!0,hint:"Entry key — search the store's entries, type a key, or bind an expression."},{key:"by",label:"By",type:"number",default:1,hint:"Amount to add; may be negative."}],output:[{key:"key"},{key:"value"},{key:"version"}]},{app:Je,action:"list",label:"List entries",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"prefix",label:"Prefix",type:"string",hint:"Only entries whose key starts with this."},{key:"cursor",label:"Cursor",type:"string",hint:"The nextCursor of a previous page."},{key:"limit",label:"Limit",type:"number",default:50,hint:"Page size, at most 200."}],output:[{key:"items"},{key:"nextCursor"}]},{app:Je,action:"query",label:"Query rows",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"where",label:"Where",type:"json",hint:"Column equality filter."},{key:"order",label:"Order",type:"string",hint:"Column to order by; prefix with - for descending."},{key:"limit",label:"Limit",type:"number",hint:"Maximum rows to return."}],output:[{key:"items"}]},{app:Je,action:"insert",label:"Insert row",displayName:"Store",group:"compute",icon:lt,ports:{in:1,out:1},params:[{key:"store",label:"Store",type:"data-store",required:!0,hint:"Name of a data store in this account and project."},{key:"row",label:"Row",type:"json",required:!0,hint:"The row, keyed by column name."},{key:"ttlSeconds",label:"TTL (seconds)",type:"number",hint:"Expire the entry after this many seconds. Omit to keep it."}],output:[{key:"key"},{key:"value"},{key:"version"}]},{app:ac,action:"save",label:"Save file",displayName:"Files",group:"compute",icon:Oc,ports:{in:1,out:1},params:[{key:"path",label:"Path",type:"string",required:!0,hint:"Where to save the file in this account and project, such as reports/summary.csv. Saving to the same path again adds a version."},{key:"text",label:"Text",type:"text",hint:"Text to save. Use exactly one of Text, CSV or File."},{key:"csv",label:"CSV table",type:"json",hint:"A table from a CSV step, saved as CSV text. Use exactly one of Text, CSV or File."},{key:"file",label:"File",type:"file",hint:"A file from an earlier step. Use exactly one of Text, CSV or File."},{key:"contentType",label:"Content type",type:"string",hint:"Optional media type, such as text/plain. Defaults to one that fits the content."}],output:[{key:"fileId"},{key:"versionId"},{key:"path"},{key:"size"},{key:"sha256"},{key:"contentType"}]}];function Pt(e,t){return wt.find(s=>s.app===e&&s.action===t)}function Hc(e,t){var s;return((s=Pt(e,t))==null?void 0:s.label)??t}function zc(e,t){var s;return((s=Pt(e,t))==null?void 0:s.icon)??""}function Nr(e,t){var s;return((s=Pt(e,t))==null?void 0:s.params)??[]}function mn(e,t){const s={};for(const o of Nr(e,t))o.default!==void 0&&(s[o.key]=o.default);return s}function Vc(e,t){return e.q===t.q&&(e.category??"")===(t.category??"")&&(e.ids??[]).join(",")===(t.ids??[]).join(",")}function Sr(e,t=0){return{query:e,generation:t,status:"loading",apps:[],hasMore:!1}}function Jc(e,t){const s=new Set(e.map(a=>a.id)),o=[];for(const a of t)s.has(a.id)||(s.add(a.id),o.push(a));return o.length===0?e:[...e,...o]}function Kc(e,t){switch(t.type){case"query-changed":return t.generation===e.generation&&Vc(t.query,e.query)?e:Sr(t.query,t.generation);case"load-more":return e.status!=="ready"||!e.hasMore?e:{...e,status:"loading-more"};case"retry":return e.status!=="error"?e:{...e,status:e.apps.length===0?"loading":"loading-more"};case"page-loaded":{if(t.generation!==e.generation)return e;const s=Jc(e.apps,t.apps),o=t.nextCursor!==void 0&&t.nextCursor===t.requestedCursor,a=!!t.nextCursor&&!o;return{...e,status:"ready",apps:s,cursor:a?t.nextCursor:void 0,hasMore:a,total:typeof t.total=="number"?t.total:e.total,error:void 0}}case"page-failed":return t.generation!==e.generation?e:{...e,status:"error",error:t.error};default:return e}}function Gc(e){return e.filter(t=>!pt(t.id))}function ks(e,t,s){if(s<=0)return[];const o=[];for(const a of e)if(!t.has(a)&&(o.push(a),o.length>=s))break;return o}function Yc(e,t){const s=[];for(const o of e){const a=t.get(o);a&&s.push(a)}return s}const Cr=b.createContext(void 0);function ya(e,t){var o;if(e)return e;if(t)return t;if(typeof document>"u")return"light";const s=document.documentElement.getAttribute("data-theme");return s==="dark"||s==="light"?s:(o=window.matchMedia)!=null&&o.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function ts(e){const t=b.useContext(Cr),[s,o]=b.useState(()=>ya(e,t));return b.useEffect(()=>{if(e){o(e);return}if(t){o(t);return}if(typeof window>"u")return;const a=()=>o(ya(void 0,t)),r=window.matchMedia("(prefers-color-scheme: dark)");r.addEventListener("change",a);const i=new MutationObserver(a);return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),a(),()=>{r.removeEventListener("change",a),i.disconnect()}},[e,t]),s}function Mt({src:e,srcDark:t,brandColor:s,name:o,size:a=32,theme:r}){const l=ts(r)==="dark"?t??e:e,[c,u]=b.useState(void 0);if(l&&l!==c)return n.jsx("img",{src:l,width:a,height:a,alt:"",onError:()=>u(l),style:{width:a,height:a,borderRadius:6,flexShrink:0,objectFit:"contain",padding:Math.max(1,Math.round(a*.06)),boxSizing:"border-box",background:"var(--w6w-icon-swatch, var(--w6w-panel-2))"}});const d=(o??"?").split(/\s+/).slice(0,2).map(p=>{var f;return((f=p[0])==null?void 0:f.toUpperCase())??""}).join("");return n.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:a,height:a,borderRadius:6,background:s??"var(--w6w-accent)",color:"#fff",fontWeight:700,fontSize:Math.round(a*.42),flexShrink:0},children:d})}const Xc={w6w:"by W6W",verified:"Verified publisher"};function Ar({publisher:e,className:t,testId:s}){if(!e)return null;const o=e.byW6W?"w6w":e.verified?"verified":"name";return n.jsxs("span",{className:["w6w-publisher-app-badge",`w6w-publisher-app-badge-${o}`,t].filter(Boolean).join(" "),"data-publisher-kind":o,"data-publisher-slug":e.slug,title:e.displayName,"data-testid":s,children:[o==="name"?null:n.jsx("span",{className:"w6w-publisher-app-badge-label",children:Xc[o]}),o==="w6w"?null:n.jsx("span",{className:"w6w-publisher-app-badge-name",children:e.displayName})]})}const ao=b.createContext(null);function Qc({api:e,theme:t,children:s}){const o=n.jsx(ao.Provider,{value:e,children:n.jsx(Cr.Provider,{value:t,children:s})});return t?n.jsx("div",{"data-theme":t,style:{display:"contents"},children:o}):o}function Ee(){const e=b.useContext(ao);if(!e)throw new Error("useW6WApi must be used inside <W6WUIProvider>. Wrap your app root with <W6WUIProvider api={api}>...</W6WUIProvider>.");return e}function rn(){return b.useContext(ao)??void 0}const Er=b.createContext(void 0),Tr=b.createContext(void 0);function Zc({project:e,workflowId:t,children:s}){return n.jsx(Er.Provider,{value:e,children:n.jsx(Tr.Provider,{value:t,children:s})})}function ro(){return b.useContext(Er)}function eu(){return b.useContext(Tr)}const js=8,tu=60,nu=300;function ga(e){const t=e.modelProvider;return!t||typeof t!="object"?null:t}function su(e){if(!e)return null;if(e.supported)return{text:"Bridge supported",title:"Bridge supported"};const t=typeof e.reason=="string"?e.reason.trim():"";return{text:t===""?"unsupported":`unsupported — ${t}`,title:t===""?"Bridge not supported":t}}function ft({onSelectApp:e,theme:t,filter:s,searchPlaceholder:o,emptyMessage:a,search:r=!0,searchValue:i,onSearchChange:l,emptyAction:c,apps:u,categoryFilter:d=!1,providerFilter:p=!1,bridgeSupport:f,category:h,hasTriggers:m,publisher:y,publisherFilter:g=!1,onPublisherChange:w,ids:x,pageLimit:v=tu,loadPage:C}){const O=Ee(),j=u!==void 0,S=x&&x.length>0?x.join(","):"",N=!j&&(C!==void 0||typeof O.listAppsPage=="function"),P=b.useRef(C);P.current=C;const[W,T]=b.useState(null),[F,E]=b.useState(null);b.useEffect(()=>{if(j||N)return;const q=O.listApps;if(typeof q!="function"){T([]);return}let pe=!1;return q().then(ce=>!pe&&T(ce)).catch(ce=>!pe&&E(ce.message)),()=>{pe=!0}},[O,j,N]);const[_,R]=b.useReducer(Kc,Sr({q:"",category:h,ids:x},0)),[G,U]=b.useState(""),$=i??G,I=q=>{i===void 0&&U(q),l==null||l(q)},[V,K]=b.useState($.trim()),te=b.useRef(0),H=b.useRef(null),[Y,J]=b.useState(void 0),M=y!==void 0?y:Y,ee=q=>{y===void 0&&J(q),w==null||w(q)},Z=b.useCallback((q,pe,ce)=>{var ge;const k=P.current,L=O.listAppsPage;if(!k&&!L)return;(ge=H.current)==null||ge.abort();const B=new AbortController;H.current=B;let oe;try{oe=k?k({q:q.q||void 0,cursor:ce,limit:v,...q.ids?{ids:q.ids}:{},signal:B.signal}):L({q:q.q||void 0,category:q.category,...m?{hasTriggers:!0}:{},...M?{publisher:M}:{},...q.ids?{ids:q.ids}:{},cursor:ce,limit:v,compact:!0,signal:B.signal})}catch(ae){oe=Promise.reject(ae)}oe.then(ae=>{if(te.current===pe){if(!ae||!Array.isArray(ae.apps)){R({type:"page-failed",generation:pe,error:"The server returned a malformed apps page."});return}R({type:"page-loaded",generation:pe,apps:ae.apps,nextCursor:ae.nextCursor,requestedCursor:ce,total:typeof ae.total=="number"?ae.total:void 0})}}).catch(ae=>{if(te.current!==pe||ae instanceof Error&&ae.name==="AbortError")return;const se=ae==null?void 0:ae.code;if(ce!==void 0&&(se==="snapshot_expired"||se==="unknown_snapshot")){const Oe=++te.current;R({type:"query-changed",query:q,generation:Oe}),Z(q,Oe,void 0);return}R({type:"page-failed",generation:pe,error:ae.message})})},[O,v,m,M]);b.useEffect(()=>{if(!N)return;const q=setTimeout(()=>K($.trim()),nu);return()=>clearTimeout(q)},[$,N]),b.useEffect(()=>{if(!N)return;const q=++te.current,pe={q:V,category:h,...S?{ids:S.split(",")}:{}};return R({type:"query-changed",query:pe,generation:q}),Z(pe,q,void 0),()=>{var ce;(ce=H.current)==null||ce.abort()}},[N,V,h,S,Z]),b.useEffect(()=>{if(N)return()=>{var q;return(q=H.current)==null?void 0:q.abort()}},[N]);const A=()=>{if(!N||_.status!=="ready"||!_.hasMore)return;const q=te.current;R({type:"load-more"}),Z(_.query,q,_.cursor)},z=()=>{!N||_.status!=="error"||(R({type:"retry"}),Z(_.query,te.current,_.cursor))},[Q,ie]=b.useState([]),[X,Ce]=b.useState(!1),[ye,xe]=b.useState(!1),ve=q=>n.jsx("div",{className:"w6w-apppicker-host",children:q});let ke,de=null,D=!1,re=!1,he=null,Ae=!1;if(j?ke=u??null:N?(ke=_.apps,Ae=_.status==="loading",D=_.status==="loading-more",re=_.hasMore,_.status==="error"&&(_.apps.length===0?de=_.error??"Failed to load apps.":he=_.error??"Failed to load apps.")):(ke=W,de=F),!N&&de)return ve(n.jsx("div",{className:"w6w-result w6w-error",children:de}));if(!N&&ke===null)return ve(n.jsx("p",{className:"w6w-muted w6w-small",children:"Loading apps…"}));ke??(ke=[]);const Fe=Gc(ke),Le=s?Fe.filter(s):Fe;if(!N&&Le.length===0)return ve(n.jsxs("div",{className:"w6w-stack",children:[n.jsx("p",{className:"w6w-muted w6w-small",children:a??"No apps registered yet. Register one from the Apps page first."}),c]}));const fe=d?Fl(Le):[],Be=fe.slice(0,js),sn=fe.slice(js).filter(q=>Q.includes(q.slug)),rt=[...Be,...sn],it=fe.length-rt.length,vt=X?fe:rt,kt=q=>ie(pe=>pe.includes(q)?pe.filter(ce=>ce!==q):[...pe,q]),jt=()=>ie([]),Nt=Le.filter(q=>ga(q)!==null).length,St=p&&Nt>0,be=St&&ye,Me=be?Le.filter(q=>ga(q)!==null):Le,Ct=(()=>{const q=new Map;for(const pe of Le){const ce=pe.publisher;ce&&typeof ce.slug=="string"&&ce.slug!==""&&!q.has(ce.slug)&&q.set(ce.slug,ce.displayName||ce.slug)}return M&&!q.has(M)&&q.set(M,M),[...q].map(([pe,ce])=>({slug:pe,label:ce}))})(),Ye=g&&Ct.length>0,De=Ye&&M!==void 0,Xe=d&&Q.length>0?Me.filter(q=>Ll(q,Q)):Me,$e=N?Xe:[...Xe].sort((q,pe)=>q.displayName.localeCompare(pe.displayName,void 0,{sensitivity:"base"})),me=N?"":$.trim().toLowerCase(),Ve=$.trim().length>0,qe=me?$e.filter(q=>q.displayName.toLowerCase().includes(me)||q.id.toLowerCase().includes(me)):$e,Dt=s!==void 0&&Le.length!==Fe.length||be&&Me.length!==Le.length||d&&Q.length>0&&Xe.length!==Me.length,ne=(d&&Q.length>0||be||De)&&qe.length===0,Te=be&&Q.length===0,Pe=()=>{ie([]),xe(!1),M!==void 0&&ee(void 0),I("")};return ve(n.jsxs("div",{className:"w6w-stepbuilder-apps",children:[r&&n.jsx("input",{type:"text",className:"w6w-stepbuilder-search",placeholder:o??"Search apps…",value:$,onChange:q=>I(q.target.value),"aria-label":"Search apps"}),(St||d&&fe.length>0||Ye)&&n.jsxs("div",{className:"w6w-apppicker-cats",children:[Ye&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"w6w-muted w6w-small",children:"Publisher"}),Ct.map(q=>n.jsx("button",{type:"button",className:"w6w-apppicker-chip","aria-pressed":M===q.slug,"aria-label":`Filter by ${q.label}`,onClick:()=>ee(M===q.slug?void 0:q.slug),children:q.label},q.slug))]}),St&&n.jsxs("button",{type:"button",className:"w6w-apppicker-chip w6w-apppicker-provider-toggle","aria-pressed":ye,"aria-label":"Filter to model providers",onClick:()=>xe(q=>!q),children:["Model providers ",n.jsxs("span",{className:"w6w-muted",children:["(",Nt,")"]})]}),d&&fe.length>0&&n.jsxs(n.Fragment,{children:[vt.map(q=>n.jsxs("button",{type:"button",className:"w6w-apppicker-chip","aria-pressed":Q.includes(q.slug),"aria-label":`Filter by ${q.label}`,onClick:()=>kt(q.slug),children:[q.label," ",n.jsxs("span",{className:"w6w-muted",children:["(",q.count,")"]})]},q.slug)),!X&&it>0&&n.jsxs("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:()=>Ce(!0),children:["+",it," more"]}),X&&fe.length>js&&n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:()=>Ce(!1),children:"Show less"}),Q.length>0&&n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:jt,children:"Clear"})]})]}),N&&Ae?n.jsx("p",{className:"w6w-muted w6w-small",children:"Loading apps…"}):N&&de?n.jsxs("div",{className:"w6w-result w6w-error",children:[de," ",n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:z,children:"Retry"})]}):qe.length===0&&!re?ne?n.jsxs("div",{className:"w6w-stack",children:[n.jsx("p",{className:"w6w-muted w6w-small",children:De?Ve?`No apps from this publisher match “${$}”.`:"No apps from this publisher.":Te?Ve?`No model providers match “${$}”.`:"No apps declare a model provider.":Ve?`No apps match “${$}” in the selected categories.`:"No apps match the selected categories."}),n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:Pe,children:"Clear filters"})]}):N?n.jsxs("div",{className:"w6w-stack",children:[n.jsx("p",{className:"w6w-muted w6w-small",children:Ve?`No apps match “${$}”.`:a??"No apps registered yet. Register one from the Apps page first."}),!Ve&&c]}):n.jsxs("p",{className:"w6w-muted w6w-small",children:["No apps match “",$,"”."]}):n.jsxs(n.Fragment,{children:[qe.length===0&&re?n.jsx("p",{className:"w6w-muted w6w-small",children:"No matching apps on this page yet — try “Load more”."}):n.jsx("div",{className:"w6w-stepbuilder-list w6w-apppicker-grid w6w-stepbuilder-scroll",children:qe.map(q=>{const pe=f==null?void 0:f.get(q.id),ce=su(pe);return n.jsxs("button",{type:"button",className:"w6w-stepbuilder-item w6w-apppicker-card",onClick:()=>e(q),children:[n.jsx(Mt,{src:q.iconSvg,srcDark:q.iconSvgDark,brandColor:q.brandColor,name:q.displayName,theme:t,size:24}),n.jsxs("span",{className:"w6w-stepbuilder-item-main",children:[n.jsx("strong",{children:q.displayName}),n.jsx("code",{className:"w6w-apppicker-card-id",children:q.id}),q.version&&n.jsxs("span",{className:"w6w-apppicker-card-version",children:["v",q.version]}),q.publisher&&n.jsx(Ar,{publisher:q.publisher,testId:`apppicker-publisher-${q.id}`}),ce&&n.jsx("span",{className:pe!=null&&pe.supported?"w6w-chip w6w-apppicker-card-bridge":"w6w-chip w6w-apppicker-card-bridge w6w-apppicker-card-bridge-unsupported",title:ce.title,children:ce.text})]})]},q.id)})}),N&&typeof _.total=="number"&&n.jsx("div",{className:"w6w-small w6w-apppicker-count",children:Dt?`${qe.length} ${qe.length===1?"app":"apps"}`:`${_.apps.length} of ${_.total}`}),N&&he&&n.jsxs("div",{className:"w6w-result w6w-error w6w-small",children:[he," ",n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm",onClick:z,children:"Retry"})]}),N&&re&&!he&&n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost w6w-btn-sm w6w-apppicker-load-more",onClick:A,disabled:D,children:D?"Loading more…":"Load more"})]})]}))}const io={"&":{fontSize:"13px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",backgroundColor:"var(--w6w-panel-2)",color:"var(--w6w-text)",border:"1px solid var(--w6w-border)",borderRadius:"8px"},"&.cm-focused":{outline:"none",borderColor:"var(--w6w-accent)"},".cm-gutters":{backgroundColor:"var(--w6w-panel)",color:"var(--w6w-muted)",border:"none",borderRight:"1px solid var(--w6w-border)"},".cm-scroller":{overflow:"auto",borderRadius:"7px"},".cm-content":{paddingTop:"var(--w6w-sp-2)",paddingBottom:"var(--w6w-sp-2)"},".cm-line":{paddingLeft:"var(--w6w-sp-2)"}};function Nn(e){return e.kind??"foreach"}function Or(e,t){if(!e)return;const s=[...e.outer??[],e],o=s.filter(t);if(o.length===0)return;if(o.length===s.length)return e;const{outer:a,...r}=o[o.length-1];return o.length>1?{...r,outer:o.slice(0,-1)}:r}function Zt(e){return Or(e,t=>Nn(t)==="foreach")}function lo(e){return Or(e,t=>Nn(t)!=="foreach")}function zn(e){const t=[{key:"index",label:"Index"},{key:"iteration",label:"Pass"}];return Nn(e)==="paginate"&&t.push({key:"page",label:"Page"},{key:"continuation",label:"Continuation"},{key:"meta",label:"Meta"}),t.push({key:"previous",label:"Previous decision"}),t}function xa(e){return Nn(e)!=="paginate"?{index:0,iteration:1,previous:null}:{index:0,iteration:1,page:e.pageStart??1,continuation:null,meta:null,previous:null}}function co(e){const t=lo(e);if(!t)return;const s=[...t.outer??[],t];return{...xa(t),loops:Object.fromEntries(s.map(o=>[o.foreachId,xa(o)]))}}function va(e){return{children:Object.create(null),detail:e}}function Ts(e,t){return Object.hasOwn(e.children,t)?e.children[t]:void 0}function Rr(e={}){var i;const t=va(),s=(l,c)=>{var d;let u=t;for(const p of l)u=(d=u.children)[p]??(d[p]=va());c&&(u.detail=c)},o=(l,c=[])=>{for(const u of c)s([...l,...u.path?u.key.split("."):[u.key]],u.declaredOnly?"Declared field — test the step to verify":u.label)};for(const l of["nodes","state","consts","trigger","foreach"])s([l]);for(const l of e.vars??[])s(["state",l],"Workflow variable");o(["state"],(i=e.stateShape)==null?void 0:i.fields);for(const l of e.constants??[])s(["consts",l],"Account constant");for(const l of e.steps??[])if(s(["nodes",l.id],l.label??"Earlier step"),s(["nodes",l.id,"output"],l.needsTest?"Test this step to discover fields":"Step output"),o(["nodes",l.id,"output"],l.outputs),l.hasMeta)for(const c of["app","version","action","connectionId"])s(["nodes",l.id,"meta",c]);for(const l of e.nodeConfigs??[])for(const c of l.keys)s(["nodes",l.id,"meta","config",c]);for(const[l,c]of Object.entries(e.nodeMeta??{}))for(const u of Object.keys(c))s(["nodes",l,"meta",u]);s(["trigger","type"]);const a=Zt(e.loop);if(a){s(["foreach","item"]),s(["foreach","index"]),o(["foreach","item"],a.itemOutputs);for(const l of[...a.outer??[],a])s(["foreach","loops",l.foreachId,"item"]),s(["foreach","loops",l.foreachId,"index"]),o(["foreach","loops",l.foreachId,"item"],l.itemOutputs)}const r=lo(e.loop);if(r){for(const l of zn(r))s(["loop",l.key],l.label);for(const l of[...r.outer??[],r])for(const c of zn(l))s(["loop","loops",l.foreachId,c.key],c.label)}return t}const ou=`(?:"(?:[^"\\\\]|\\\\.)*"|'(?:[^'\\\\]|\\\\.)*')`,_t=`(?:${ou}|\\d+)`,au=`(?:\\s*\\.\\s*[A-Za-z_$][\\w$]*|\\s*\\[\\s*${_t}\\s*\\])`,ru="(?:\\$|ctx|run|state|vars|consts)",iu=`(?:\\$|ctx)\\.get\\(\\s*${_t}(?:\\s*,\\s*${_t})*\\s*\\)`,lu=`(?:${iu}|${ru})${au}*`,ka=new RegExp(`(?<![\\w$.])(${lu})\\s*$`),cu=new RegExp(`\\.\\s*([A-Za-z_$][\\w$]*)|\\[\\s*(${_t})\\s*\\]`,"g");function Os(e){return e[0]==='"'?JSON.parse(e):e[0]!=="'"?e:e.slice(1,-1).replace(/\\(u[0-9a-fA-F]{4}|[\\'"nrtbf])/g,(t,s)=>s.startsWith("u")?String.fromCharCode(Number.parseInt(s.slice(1),16)):{n:`
|
|
4
4
|
`,r:"\r",t:" ",b:"\b",f:"\f"}[s]??s)}function Ir(e,t){let s=e;for(const o of t)s=s&&Ts(s,o);return s}function ja(e,t,s){var l;const o=/^(\$|ctx)\.get\((.*)\)/s.exec(e);let a,r,i=!1;if(o){if(o[1]==="ctx"!==s)return;const c=o[2].match(new RegExp(_t,"g"))??[];a=Ir(t,c.map(Os)),r=e.slice(o[0].length)}else{const c=(l=/^(\$|ctx|run|state|vars|consts)/.exec(e))==null?void 0:l[0];if(!c||c==="$"&&s||c==="ctx"&&!s)return;i=c==="$"||c==="ctx",i||c==="run"?a=t:a=Ts(t,c==="vars"?"state":c),r=e.slice(c.length),c==="run"&&(a={children:Object.fromEntries(["nodes","trigger","foreach","loop"].filter(u=>t.children[u]).map(u=>[u,t.children[u]]))})}for(const c of r.matchAll(cu)){if(s&&c[1]&&!i)return;a=a&&Ts(a,c[1]??Os(c[2])),i=!1}return a}function uu(e,t,s){if(e.tokenBefore(["Comment","LineComment","BlockComment"]))return null;const o=s==="python",a=e.state.sliceDoc(0,e.pos),r=e.tokenBefore(["String","TemplateString"]);let i,l=e.pos,c,u=!1,d,p=!1;const f=new RegExp(`(?<![\\w$.])(?:${o?"ctx":"\\$"})\\.get\\(\\s*((?:${_t}\\s*,\\s*)*)(["']?)([^"'\\\\,\\n]*)$`).exec(a),h=/\[\s*(["']?)([^"'\\\]\n]*)$/.exec(a),m=/\.([\w$]*)$/.exec(a);try{if(f)i=Ir(t,(f[1].match(new RegExp(_t,"g"))??[]).map(Os)),c=f[2],l=e.pos-f[3].length-c.length;else if(h){const w=ka.exec(a.slice(0,h.index));if(!w)return null;i=ja(w[1],t,o),c=h[1],u=!0,l=e.pos-h[2].length-c.length}else if(m){const w=ka.exec(a.slice(0,m.index));if(!w||o&&w[1]!=="ctx")return null;i=ja(w[1],t,o),p=w[1]===(o?"ctx":"$"),d=m.index,l=m.index+1}else if(o&&!r){const w=e.matchBefore(/\w*/);return!w||!e.explicit&&w.from===w.to?null:{from:w.from,options:["ctx","input","run","state","vars","consts","digest","print"].map(x=>({label:x,type:"variable"}))}}}catch{return null}if(!i||r&&(c===void 0||!c||r.from!==l))return null;let y=e.pos;if(c!==void 0){const w=e.state.sliceDoc(e.pos),x=c?new RegExp(`^[^${c}\\\\
|
|
5
|
-
]*${c}`).exec(w):null;x&&(y+=x[0].length),u&&e.state.sliceDoc(y,y+1)==="]"&&y++}const g=Object.entries(i.children).map(([w,x])=>{const v=JSON.stringify(w);return{label:w,type:"property",detail:x.detail,apply:c!==void 0?`${v}${u?"]":""}`:/^[A-Za-z_$][\w$]*$/.test(w)?w:(C,O,j,S)=>{const N=d??j;C.dispatch({changes:{from:N,to:S,insert:`[${v}]`},selection:{anchor:N+v.length+2}})}}});if(p&&g.push({label:"get",type:"function",detail:`Read a path; missing values return ${o?"None":"undefined"}`}),c!==void 0){const w=e.state.sliceDoc(l+c.length,e.pos).trimStart().toLowerCase();return{from:l,to:y,filter:!1,options:g.filter(x=>x.label.toLowerCase().startsWith(w))}}return g.length?{from:l,to:y,options:g}:null}function du(e="javascript",t=Rr()){let s,o=0,a=!1;const r=new Map,i=()=>{s==null||s.terminate(),s=void 0;for(const c of r.values())c([]);r.clear()},l=async c=>{if(a)return null;const u=uu(c,t,e);if(u||e==="python")return u;const d=c.matchBefore(/[\w$]*/);if(a||!d||!c.explicit&&d.from===d.to&&c.state.sliceDoc(c.pos-1,c.pos)!==".")return null;s||(s=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/assets/script-completion.worker-BCQQpdvq.js").href:new URL("assets/script-completion.worker-BCQQpdvq.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:ws&&ws.tagName.toUpperCase()==="SCRIPT"&&ws.src||new URL("connection-app-meta-ChRGxZex.cjs",document.baseURI).href),{type:"module"}),s.onmessage=f=>{var h;(h=r.get(f.data.id))==null||h(f.data.options),r.delete(f.data.id)},s.onerror=i);const p=await new Promise(f=>{const h=++o;r.set(h,f),c.addEventListener("abort",()=>{r.delete(h),f([])},{onDocChange:!0}),s==null||s.postMessage({id:h,code:c.state.doc.toString(),position:c.pos,scope:t})});return c.aborted||!p.length?null:{from:d.from,options:p}};return[(e==="python"?ur.pythonLanguage:e==="typescript"?Wn.typescriptLanguage:Wn.javascriptLanguage).data.of({autocomplete:l}),Ys.ViewPlugin.define(()=>(a=!1,{destroy(){a=!0,i()}}))]}function pu(e){switch(e){case"javascript":return Wn.javascript();case"typescript":return Wn.javascript({typescript:!0});case"python":return ur.python()}}function uo(e){const t=ts(e.theme),{copied:s,copy:o}=ue.useCopyToClipboard(e.value),a=b.useMemo(()=>[...e.language?[pu(e.language)]:[],...e.language?[du(e.language,e.scriptScope)]:[],Ys.EditorView.theme(io)],[e.language,e.scriptScope]);return n.jsxs("div",{className:"w6w-code-editor","aria-label":e["aria-label"]??"Code editor",children:[n.jsx(dr,{value:e.value,onChange:e.onChange,extensions:a,placeholder:e.placeholder,readOnly:e.readOnly,theme:t,height:e.height,minHeight:e.minHeight??"160px",maxHeight:e.maxHeight,onCreateEditor:e.onCreateEditor,basicSetup:{lineNumbers:!0,foldGutter:!1,highlightActiveLine:!e.readOnly,bracketMatching:!0,closeBrackets:!0}}),e.copyable!==!1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${s?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void o(),children:s?n.jsx(ue.CheckGlyph,{}):n.jsx(ue.CopyGlyph,{})}),n.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:s?"Copied":""})]})]})}function fu(){const e=pr.jsonParseLinter();return t=>t.state.doc.toString().trim()===""?[]:e(t)}function tt(e){const t=ts(e.theme),{copied:s,copy:o}=ue.useCopyToClipboard(e.value),a=b.useMemo(()=>[pr.json(),...e.showDiagnostics===!1?[]:[na.linter(fu()),na.lintGutter()],Ys.EditorView.theme(io)],[e.showDiagnostics]);function r(i){var l,c,u,d;if(e.onChange(i),!(!e.onValidChange&&!e.onValidityChange)){if(i.trim().length===0){(l=e.onValidityChange)==null||l.call(e,{valid:!1,error:"Empty"});return}try{const p=JSON.parse(i);(c=e.onValidChange)==null||c.call(e,p),(u=e.onValidityChange)==null||u.call(e,{valid:!0})}catch(p){(d=e.onValidityChange)==null||d.call(e,{valid:!1,error:p.message})}}}return n.jsxs("div",{className:"w6w-json-editor","aria-label":e["aria-label"]??"JSON editor",children:[n.jsx(dr,{value:e.value,onChange:r,extensions:a,placeholder:e.placeholder,readOnly:e.readOnly,editable:!e.readOnly,theme:t,height:e.height,minHeight:e.minHeight??"240px",maxHeight:e.maxHeight,onCreateEditor:e.onCreateEditor,onBlur:e.onBlur,onFocus:e.onFocus,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!e.readOnly,autocompletion:!0,bracketMatching:!0,closeBrackets:!0}}),e.overlay,e.copyable!==!1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${s?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void o(),children:s?n.jsx(ue.CheckGlyph,{}):n.jsx(ue.CopyGlyph,{})}),n.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:s?"Copied":""})]})]})}const hu={padding:"8px 8px 2px",fontSize:"0.75em",fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",opacity:.6,cursor:"default"};function mu(e){const t=[];for(const s of e){const o=t[t.length-1];o&&o.group===s.group?o.options.push(s):t.push({group:s.group,options:[s]})}return t}function $r(e,t,s){return e*t>.6*s}function Pr(e,t){const s=t.trim().toLowerCase();return s?e.filter(o=>{var a;return o.label.toLowerCase().includes(s)||o.value.toLowerCase().includes(s)||(((a=o.keywords)==null?void 0:a.toLowerCase().includes(s))??!1)}):e}const Na={display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"none",width:"1.25em",height:"1.25em",overflow:"hidden"},wu=240,Sa={display:"block",fontSize:"0.85em",opacity:.65,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},bu={position:"absolute",zIndex:50,left:0,right:0,top:"100%",overflowY:"auto",overscrollBehavior:"contain",margin:0,padding:4,listStyle:"none",background:"var(--w6w-panel)",color:"var(--w6w-text)",border:"1px solid var(--w6w-border)",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)"};function st({options:e,value:t,onChange:s,placeholder:o,disabled:a,"aria-label":r,mode:i="auto",forceSelection:l=!0,optionHeight:c=32,listMaxHeight:u=wu,className:d,onInputChange:p,emptyText:f="No matches",footer:h}){const m=i==="combobox"||i==="auto"&&$r(e.length,c,typeof window>"u"?0:window.innerHeight),y=b.useId(),g=e.find($=>$.value===t),w=(g==null?void 0:g.label)??(l?"":t),[x,v]=b.useState(w),[C,O]=b.useState(!1),[j,S]=b.useState(!1),[N,P]=b.useState(0),W=b.useRef(null);b.useEffect(()=>{v(w)},[w]);const T=b.useMemo(()=>j?Pr(e,x):e,[e,x,j]),F=b.useMemo(()=>({...bu,maxHeight:u}),[u]);if(!m)return n.jsxs("select",{className:d,value:t,disabled:a,"aria-label":r,onChange:$=>s($.target.value),children:[o!==void 0&&t===""&&n.jsx("option",{value:"",disabled:!0,children:o}),mu(e).map($=>$.group===void 0?$.options.map(I=>n.jsx("option",{value:I.value,children:I.label},I.value)):n.jsx("optgroup",{label:$.group,children:$.options.map(I=>n.jsx("option",{value:I.value,children:I.label},I.value))},`${$.group}-${$.options[0].value}`))]});const E=$=>`${y}-opt-${$}`,_=()=>{O(!1),S(!1)},R=$=>{v($.label),s($.value),_()},G=$=>{$.key==="ArrowDown"?($.preventDefault(),C?P(I=>Math.min(I+1,T.length-1)):O(!0)):$.key==="ArrowUp"?($.preventDefault(),C?P(I=>Math.max(I-1,0)):O(!0)):$.key==="Enter"?C&&T[N]?($.preventDefault(),R(T[N])):l||(x!==w&&s(x),_()):$.key==="Escape"&&(C&&$.stopPropagation(),v(w),_())},U=()=>{l?v(w):x!==w&&s(x),_()};return n.jsxs("div",{ref:W,className:"w6w-combobox",style:{position:"relative"},children:[(g==null?void 0:g.icon)!==void 0&&!j&&n.jsx("span",{"aria-hidden":"true",className:"w6w-combobox-icon",style:{...Na,position:"absolute",left:"0.6em",top:"50%",transform:"translateY(-50%)",pointerEvents:"none"},children:g.icon}),n.jsx("input",{type:"text",role:"combobox",className:d,style:(g==null?void 0:g.icon)!==void 0&&!j?{paddingLeft:"2.2em"}:void 0,value:x,disabled:a,placeholder:o,"aria-label":r,"aria-expanded":C,"aria-controls":`${y}-list`,"aria-autocomplete":"list","aria-activedescendant":C&&T[N]?E(N):void 0,autoComplete:"off",onFocus:()=>O(!0),onChange:$=>{v($.target.value),p==null||p($.target.value),S(!0),P(0),O(!0)},onKeyDown:G,onBlur:U}),C&&n.jsxs("div",{id:`${y}-list`,role:"listbox",tabIndex:-1,"aria-label":r,style:F,children:[T.map(($,I)=>{var V;return n.jsxs(b.Fragment,{children:[$.group!==void 0&&$.group!==((V=T[I-1])==null?void 0:V.group)&&n.jsx("div",{role:"presentation",className:"w6w-combobox-group",style:hu,children:$.group}),n.jsx("div",{id:E(I),role:"option",tabIndex:-1,"aria-selected":$.value===t,style:{padding:"6px 8px",cursor:"pointer",borderRadius:4,background:I===N?"var(--w6w-panel-2)":void 0},onMouseDown:K=>{K.preventDefault(),R($)},onMouseEnter:()=>P(I),children:$.icon!==void 0?n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"0.5em"},children:[n.jsx("span",{"aria-hidden":"true",className:"w6w-combobox-icon",style:Na,children:$.icon}),n.jsxs("span",{style:{minWidth:0,flex:1},children:[$.label,$.detail!==void 0&&n.jsx("span",{className:"w6w-combobox-detail",style:Sa,children:$.detail})]})]}):n.jsxs(n.Fragment,{children:[$.label,$.detail!==void 0&&n.jsx("span",{className:"w6w-combobox-detail",style:Sa,children:$.detail})]})})]},$.value)}),T.length===0&&n.jsx("div",{role:"presentation",style:{padding:"6px 8px",opacity:.6},children:f}),h!==void 0&&n.jsx("div",{role:"presentation",className:"w6w-combobox-footer",style:{padding:"6px 8px",opacity:.6,fontSize:"0.85em"},children:h})]})]})}function ns(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.source==="resolveFields"}function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.type==="expr"&&Array.isArray(e.parts)}function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.type==="secret"&&typeof e.ciphertext=="string"&&typeof e.iv=="string"}function Ca(e){return e.kind==="text"?{kind:"text",value:e.value??""}:e.kind==="expr"?{kind:"expr",expr:e.expr}:{kind:e.kind,ref:e.ref??""}}function Pn(e){const t=e.filter(o=>o.kind!=="text"||(o.value??"")!=="");if(t.length===0)return"";if(t.some(o=>o.kind==="render"))return{type:"expr",parts:t.map(Ca)};let s="";for(const o of t){if(o.kind==="text"){s+=o.value??"";continue}yu(s)%2===1&&(s+="\\"),s+=le.serializeTemplate([Ca(o)])}return s}function yu(e){let t=0;for(;t<e.length&&e[e.length-1-t]==="\\";)t+=1;return t}const _r={var:!0,vars:!0,state:!0,steps:!0,nodes:!0,trigger:!0,foreach:!0,loop:!0,inputs:!0,output:!0,secrets:!0,documents:!0,connections:!0,const:!0};Object.freeze(Object.keys(_r));const Aa=e=>Object.prototype.hasOwnProperty.call(_r,e),Ea=["state","var","vars"];function Fr(e){for(const t of Ea)if(e===t||e.startsWith(`${t}.`)){const s=e.slice(t.length);return[...new Set([e,...Ea.map(o=>o+s)])]}return[e]}function Ta(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}function yt(e){const t=le.parseTemplate(e,"editor",gu);return t.every(ss)?t:[{kind:"text",value:e}]}function ss(e){if(e.kind==="var"){const t=e.ref??"";return!le.hasRefusedChainToken(t)&&Aa(Ta(t))}if(e.kind==="expr"){const t=le.coalesceOperandRefs(e.expr);return t===null?!0:t.every(s=>Aa(Ta(s)))}return!0}const gu={isOurs:ss,backslash:"keep"},Lr={isOurs:ss,backslash:"strip"};function ht(e){return ot(e)?!0:typeof e=="string"&&e.includes("{{")&&yt(e).some(t=>t.kind!=="text")}function os(e){if(!e.includes("{{"))return null;const t=le.parseTemplate(e,"editor",Lr);return t.every(ss)&&(t.some(s=>s.kind!=="text")||t.map(s=>s.value??"").join("")!==e)?t:null}function xu(e){return e.includes("{{")?le.parseTemplate(e,"editor",Lr).map(t=>t.kind==="text"?t.value??"":le.serializeTemplate([t])).join(""):e}function Rs(e){if(bt(e))return{parts:[],sealed:e};if(ot(e))return{parts:e.parts.map(s=>({...s})),sealed:null};const t=typeof e=="string"?e:"";return{parts:t?yt(t):[],sealed:null}}function vu(e,t){let s="";for(const o of e)switch(o.kind){case"text":s+=xu(o.value??"");break;case"var":case"render":{const a=Fr(o.ref??"").find(r=>r in t);s+=a===void 0?"":t[a];break}case"secret":s+="•••";break;case"expr":s+=le.serializeTemplate([o]);break}return s}const Vt="var.",Oa="vars.",Is="documents.",$s="const.",Ns="connections.",Ps="state.";function Mr(e){return e==="state"||e==="vars"?"var":e.startsWith(Oa)?Vt+e.slice(Oa.length):e.startsWith(Ps)?Vt+e.slice(Ps.length):e}function ku(e){return e.startsWith(Ps)?3:e.startsWith(Vt)?2:1}function Dr(e){return e.rank>0?e.value:Object.fromEntries(Array.from(e.children,([t,s])=>[t,Dr(s)]))}function po(e,t,s,o){const a={children:new Map,rank:0},r={},i={},l={};for(const[w,x]of Object.entries(e??{})){const v=Mr(w);if(v.startsWith(Vt)){const C=v.slice(Vt.length),O=ku(w);let j=a;for(const S of C.split(".")){let N=j.children.get(S);N||(N={children:new Map,rank:0},j.children.set(S,N)),j=N}O>=j.rank&&(j.value=x,j.rank=O)}else v.startsWith(Is)?r[v.slice(Is.length)]=x:v.startsWith($s)?i[v.slice($s.length)]=x:v.startsWith(Ns)&&!v.slice(Ns.length).includes(".")&&(l[v.slice(Ns.length)]=x)}const c=Dr(a),u=(t==null?void 0:t.steps)??{},d=e??{},p=Object.hasOwn(d,"foreach.item"),f=typeof d["foreach.index"]=="number",h=t==null?void 0:t.foreach,m=h?{...h}:p||f?{...p?{item:d["foreach.item"]}:{},...f?{index:d["foreach.index"]}:{}}:void 0,y=Object.keys(d).filter(w=>w.startsWith("loop.")&&!w.slice(5).includes(".")),g=t!=null&&t.loop?{...t.loop}:y.length>0?Object.fromEntries(y.map(w=>[w.slice(5),d[w]])):void 0;return{...m?{foreach:m}:{},...g?{loop:g}:{},vars:c,state:c,documents:r,connections:l,constants:i,steps:u,nodes:u,trigger:(t==null?void 0:t.trigger)??{},flat:e??{},...s?{config:s}:{},...o?{meta:o}:{}}}function ju(e,t){const s=t.split(".");let o=e;for(const a of s){if(o===null||typeof o!="object")return{present:!1,value:void 0};if(!(a in o))return{present:!1,value:void 0};o=o[a]}return{present:!0,value:o}}const Nu=/^(?:nodes|steps)\.[^.]+\.(?:meta\.)?config(?:\.|$)/,Su=/^(?:nodes|steps)\.([^.]+)\.meta(?:\.|$)/;function Cu(e,t,s){var a;if(!t&&!s)return e;const o={...e};for(const r of new Set([...Object.keys(s??{}),...Object.keys(t??{})])){const i=t==null?void 0:t[r];o[r]={...e[r],meta:{...s==null?void 0:s[r],...(a=e[r])==null?void 0:a.meta,...i?{config:i}:{}},...i?{config:i}:{}}}return o}function qr(e,t){var f;const s=Mr(e);if(t.flat&&(s.startsWith(Vt)||s.startsWith(Is)||s.startsWith($s))){const h=Fr(e).find(m=>Object.hasOwn(t.flat,m));if(h!==void 0)return{status:"resolved",ref:e,value:t.flat[h]}}const{vars:o,constants:a,config:r,meta:i,...l}=t,c=Cu(t.nodes??t.steps,r,i),u={...l,var:o,...a?{const:a}:{},nodes:c,steps:c},d=ju(u,s);if(d.present)return{status:"resolved",ref:e,value:d.value};if(Nu.test(s))return{status:"at-run",ref:e};const p=(f=Su.exec(s))==null?void 0:f[1];return p!==void 0&&(i!=null&&i[p])?{status:"at-run",ref:e}:{status:"unresolved",ref:e}}function Ra(e,t){switch(e.kind){case"text":return{status:"resolved",value:e.value??""};case"var":return qr(e.ref??"",t);case"secret":return{status:"masked",ref:e.ref};case"expr":return{status:"not-evaluated"};case"render":return{status:"not-evaluated"};default:return{status:"resolved",value:void 0}}}function fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1&&"$"in e}function ho(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1&&"$expr"in e}function mo(e,t){if(bt(e))return[{status:"masked"}];if(ot(e))return e.parts.map(s=>Ra(s,t));if(typeof e=="string"){const s=os(e);if(s)return s.map(o=>Ra(o,t))}return fo(e)?[qr(String(e.$),t)]:ho(e)?[{status:"not-evaluated"}]:[{status:"resolved",value:e}]}function _s(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null||typeof e!="object")return!1;const s=Array.isArray(e),o=Array.isArray(t);if(s!==o)return!1;if(s){const c=e,u=t;return c.length===u.length&&c.every((d,p)=>_s(d,u[p]))}const a=e,r=t,i=Object.keys(a),l=Object.keys(r);return i.length===l.length&&i.every(c=>c in r&&_s(a[c],r[c]))}function Wr(e){switch(e.status){case"resolved":return e.value===void 0?"<not set>":e.value;case"unresolved":return`<unresolved: ${e.ref}>`;case"at-run":return`<resolved at run: ${e.ref}>`;case"not-evaluated":return"<not evaluated>";case"masked":return e.ref?`<masked: ${e.ref}>`:"<masked>"}}function Au(e){return e.status==="resolved"&&e.value!==void 0?typeof e.value=="string"?e.value:JSON.stringify(e.value):String(Wr(e))}function Eu(e){return e.length===1?Wr(e[0]):e.map(Au).join("")}function wn(e,t){return Eu(mo(e,t))}function Tu(e,t){const s={};for(const o of e)s[o.key||"(no key)"]=wn(o.value,t);return s}const as=b.forwardRef(function(t,s){const{label:o,children:a,icon:r,iconSize:i,title:l,onClick:c,disabled:u,className:d,danger:p,...f}=t,h=a??(r?n.jsx(ue.Icon,{name:r,size:i??16}):null),m=Object.fromEntries(Object.entries(f).filter(([y])=>y.startsWith("data-")));return n.jsx("button",{ref:s,type:"button",className:["w6w-icon-button",p?"w6w-icon-button-danger":"",d??""].filter(Boolean).join(" "),title:l??o,"aria-label":o,"aria-pressed":f["aria-pressed"],"aria-expanded":f["aria-expanded"],"aria-controls":f["aria-controls"],"aria-haspopup":f["aria-haspopup"],disabled:u,onClick:c,...m,children:h})});as.displayName="IconButton";const Ou={default:"",wide:" w6w-modal-wide",xl:" w6w-modal-xl",full:" w6w-modal-full",fullscreen:" w6w-modal-fullscreen"};function Re({title:e,ariaLabel:t,onClose:s,children:o,size:a="default",titleIcon:r,subtitle:i,headerRight:l}){const c=b.useRef(null),u=b.useRef(null);return b.useEffect(()=>()=>{var d;(d=u.current)!=null&&d.isConnected&&u.current.focus({preventScroll:!0})},[]),b.useEffect(()=>{const d=c.current;if(!d)return;d.open||(u.current=document.activeElement,d.showModal());const p=h=>{h.preventDefault(),s()},f=h=>{if(h.target!==d)return;const m=d.getBoundingClientRect();(h.clientX<m.left||h.clientX>m.right||h.clientY<m.top||h.clientY>m.bottom)&&s()};return d.addEventListener("cancel",p),d.addEventListener("click",f),()=>{d.removeEventListener("cancel",p),d.removeEventListener("click",f)}},[s]),n.jsx("div",{className:"w6w-modal-backdrop",children:n.jsxs("dialog",{ref:c,className:`w6w-modal${Ou[a]}`,"aria-label":t??(typeof e=="string"?e:void 0),children:[n.jsxs("div",{className:"w6w-modal-header",children:[n.jsxs("h3",{className:"w6w-modal-title",children:[r,n.jsx("span",{children:e}),i&&n.jsx("span",{className:"w6w-modal-subtitle",children:i})]}),l]}),o]})})}const wo=new Set(["nodes","steps","state","var","vars","const","inputs","output","trigger","foreach","loop","documents","connections"]),Ru=/[=<>]|!=|&&|\|\||\?\?/,_n=e=>Ru.test(e)||/^\s*\(*\s*!/.test(e),Fs=e=>le.expressionReferences(e).some(_n);function Iu(e,t){var r,i,l;const[s,...o]=e.split(".");if(s==="secrets")throw new Error("Secrets can be inserted into text, but cannot be used in comparisons.");if(wo.has(s))return e;const a=[...(r=t.steps)!=null&&r.some(c=>c.id===s)?[`nodes.${s}.output`]:[],...(i=t.vars)!=null&&i.includes(s)?[`var.${s}`]:[],...(l=t.constants)!=null&&l.includes(s)?[`const.${s}`]:[]];if(a.length>1)throw new Error(`“${s}” is ambiguous. Select the field from the sources.`);if(a.length===0)throw new Error(`Unknown field “${s}”. Select a source, or put text values in quotes.`);return[a[0],...o].join(".")}function ln(e,t){var u,d,p,f,h;const s={parts:e,error:null},o=e.flatMap(m=>m.kind==="text"?yt(m.value??""):[m]);if(o.some(m=>m.kind==="render"))return s;if(o.some(Ur))return{parts:o,error:$u};if(o.some(Pu))return s;if(o.length===1&&o[0].kind==="expr"&&!Fs(o[0].expr))return{parts:o,error:null};let a=o.map(m=>{if(m.kind==="text")return m.value??"";if(m.kind==="secret")return`{{ secrets.${m.ref??""} }}`;if(m.kind==="expr"){if(Fs(m.expr)){const g=le.serializeTemplate([m]);if(!g.startsWith("{{ ="))return`(${g.slice(2,-2).trim()})`}const y=le.formatReadableExpression(m.expr);return y===null?le.serializeTemplate([m]):`(${y})`}return _n(m.ref??"")?m.ref??"":`{{ ${m.ref??""} }}`}).join("").trim();if(!_n(a))return s;const r=/^\{\{([^{}]+)\}\}$/.exec(a);r&&_n(r[1])&&(a=r[1].trim());const i=a.replace(/^[\s(!]+/,""),l=(u=/^(?:\{\{\s*)?([A-Za-z_$][\w$-]*)/.exec(i))==null?void 0:u[1],c=i.startsWith("{{")||l!==void 0&&(wo.has(l)||l==="secrets"||((d=t.steps)==null?void 0:d.some(m=>m.id===l))||((p=t.vars)==null?void 0:p.includes(l))||((f=t.constants)==null?void 0:f.includes(l)));if(!c&&!/^(?:["']|-?\d|true\b|false\b|null\b)/.test(i))return s;if(c&&!/^\s*\(*\s*!/.test(a)){const m=(h=/^(?:\{\{[^{}]+\}\}|[A-Za-z_$][\w$-]*(?:\.[\w$-]+)*)/.exec(i))==null?void 0:h[0];if(m){const y=i.slice(m.length).replace(/^[\s)]+/,"");if(!/^(?:[=<>(]|!=|&&|\|\||\?\?)/.test(y)||/^<\/?[A-Za-z][^>]*>/.test(y))return s}}try{return{parts:[{kind:"expr",expr:le.parseReadableExpression(a,y=>Iu(y,t))}],error:null}}catch(m){return{parts:o,error:m instanceof Error?m.message:"Check the expression."}}}const $u="The JSONLogic after “=” is not valid JSON. Check its quotes, brackets and commas.";function Ur(e){return e.kind==="expr"&&typeof e.expr=="string"}function Pu(e){return e.kind==="expr"&&e.expr!==null&&typeof e.expr=="object"&&!Fs(e.expr)&&le.formatReadableExpression(e.expr)===null}function _u(e){return[...new Set(e.flatMap(t=>t.kind==="expr"?le.expressionReferences(t.expr):(t.kind==="var"||t.kind==="render")&&t.ref?[t.ref]:[]))]}function Fu(e){return e.replace(/^(?:vars|state)(?=\.|$)/,"var").replace(/^steps(?=\.|$)/,"nodes")}function Lu(e){const t=Object.create(null);for(const[s,o]of Object.entries(e).sort(([a],[r])=>a.split(".").length-r.split(".").length)){const a=Fu(s).split(".");if(!wo.has(a[0])||a.some(i=>["__proto__","constructor","prototype"].includes(i)))continue;let r=t;for(const i of a.slice(0,-1)){const l=r[i],c=l&&typeof l=="object"?{...l}:{};r[i]=c,r=c}r[a[a.length-1]]=o}return t.steps=t.nodes,t.vars=t.var,t.state=t.var,t}function Mu(e,t={},s={}){const o={...t};for(const[i,l]of Object.entries(s))try{o[i]=JSON.parse(l)}catch{o[i]=l}const a=Lu(o),r=Object.fromEntries(Object.entries(o).map(([i,l])=>[i,typeof l=="string"?l:JSON.stringify(l)]));return e.map(i=>{if(i.kind!=="expr"||Ur(i))return vu([i],r);if(le.expressionReferences(i.expr).some(u=>!u||u.split(".")[0]==="secrets"))return"••••";const c=le.evaluate(i.expr,a);return typeof c=="string"?c:JSON.stringify(c)??""}).join("")}const Du=/^(?:nodes|steps)\.([^.]+)\.output(?:\.(.+))?$/,qu=/^(?:nodes|steps)\.([^.]+)\.meta\.(app|version|action|connectionId)$/,It=e=>{if(e.startsWith("var."))return e.slice(4);if(e.startsWith("vars."))return e.slice(5);if(e.startsWith("const."))return e.slice(6);const t=Du.exec(e);if(t)return t[2]?`${t[1]}.${t[2]}`:t[1];const s=qu.exec(e);return s?`${s[1]} meta · ${s[2]}`:e};function Wu(e){if(e===null||typeof e!="object"||Array.isArray(e))return;const t=Object.keys(e);if(t.length!==1||t[0]!=="var")return;const s=e.var;return typeof s=="string"?s:void 0}function Uu(e){const t=e.op==="or"?"||":"??",s=e.operands.map(o=>{const a=Wu(o);return a!==void 0?It(a):JSON.stringify(o)}).join(` ${t} `);return s.length>40?`${s.slice(0,40)}…`:s}const Bu=/[.{}]/;function Bt(e){return e===""||e!==e.trim()?!1:!Bu.test(e)}function Rn(e){return e.split(".").every(Bt)}function Hu(e){const t=new Set(e.filter(s=>s.path).map(s=>s.key));return e.map(s=>{if(!s.path)return{field:s,depth:0,name:s.key,parent:null};const o=s.key.split(".");let a=0,r=0;for(let l=1;l<o.length;l++)t.has(o.slice(0,l).join("."))&&(a++,r=l);const i=r>0?o.slice(0,r).join("."):null;return{field:s,depth:a,name:o.slice(r).join("."),parent:i}})}function Ia(e,t){const s=Hu(e),o=new Map(s.map(i=>[i.field.key,i.parent])),a=new Map;for(const i of s)i.parent!==null&&a.set(i.parent,(a.get(i.parent)??0)+1);const r=i=>{const l=o.get(i)??null;return l===null||t(l)&&r(l)};return s.filter(i=>r(i.field.key)).map(({field:i,depth:l,name:c})=>({field:i,depth:l,name:c,children:a.get(i.key)??0}))}function bn(e,t,{renderToggle:s}={}){const o=e.createElement("span");o.contentEditable="false",o.className=`w6w-expr-chip w6w-expr-chip-${t.kind}`,o.setAttribute("data-kind",t.kind);const a=e.createElement("span");a.className="w6w-expr-chip-sigil";const r=e.createElement("span");if(r.className="w6w-expr-chip-label",t.kind==="var")o.setAttribute("data-ref",t.ref??""),a.textContent="◆",r.textContent=It(t.ref??""),o.title=`Variable: ${t.ref??""}`;else if(t.kind==="render")o.setAttribute("data-ref",t.ref??""),a.textContent="▤",r.textContent=It(t.ref??""),o.title=`Render as template: ${t.ref??""}`;else if(t.kind==="secret")o.setAttribute("data-ref",t.ref??""),a.textContent="🔒",r.textContent=t.ref??"",o.title=`Secret: ${t.ref??""}`;else{const l=typeof t.expr=="string"?t.expr:JSON.stringify(t.expr??"");o.setAttribute("data-expr",l),a.textContent="ƒ";const c=le.parseCoalesceChain(t.expr);if(c)r.textContent=Uu(c),o.title=`Expression: ${le.serializeTemplate([t])}`;else{const u=le.formatReadableExpression(t.expr,It);r.textContent=u??(l.length>24?`${l.slice(0,24)}…`:l||"expr"),o.title=`Expression: ${u??l}`}}if(o.append(a,r),(t.kind==="var"||t.kind==="render")&&s){const l=e.createElement("span");l.className="w6w-expr-chip-toggle",l.setAttribute("data-render-toggle","1"),l.setAttribute("role","button");const c=t.kind==="render"?"Stop rendering as a template":"Render this as a template";l.setAttribute("aria-label",c),l.title=c,l.textContent="⇄",o.append(l)}const i=e.createElement("span");return i.className="w6w-expr-chip-x",i.setAttribute("data-x","1"),i.setAttribute("role","button"),i.setAttribute("aria-label","Remove"),i.textContent="×",o.append(i),o}const Br=new Set(["div","p"]);function Hr(e){const t=e.getAttribute("data-kind");if(t==="var"||t==="secret"||t==="render")return{kind:t,ref:e.getAttribute("data-ref")??""};if(t==="expr"){const s=e.getAttribute("data-expr")??"";let o=s;try{o=JSON.parse(s)}catch{o=s}return{kind:"expr",expr:o}}return null}function cn(e){const t=[],s=r=>{if(!r)return;const i=t[t.length-1];i&&i.kind==="text"?i.value=(i.value??"")+r:t.push({kind:"text",value:r})},o=(r,i)=>{if(r.nodeType===Node.TEXT_NODE){s(r.textContent??"");return}if(r.nodeType!==Node.ELEMENT_NODE)return;const l=r,c=Hr(l);if(c){t.push(c);return}const u=(l.tagName??"").toLowerCase();if(u==="br"){i||s(`
|
|
5
|
+
]*${c}`).exec(w):null;x&&(y+=x[0].length),u&&e.state.sliceDoc(y,y+1)==="]"&&y++}const g=Object.entries(i.children).map(([w,x])=>{const v=JSON.stringify(w);return{label:w,type:"property",detail:x.detail,apply:c!==void 0?`${v}${u?"]":""}`:/^[A-Za-z_$][\w$]*$/.test(w)?w:(C,O,j,S)=>{const N=d??j;C.dispatch({changes:{from:N,to:S,insert:`[${v}]`},selection:{anchor:N+v.length+2}})}}});if(p&&g.push({label:"get",type:"function",detail:`Read a path; missing values return ${o?"None":"undefined"}`}),c!==void 0){const w=e.state.sliceDoc(l+c.length,e.pos).trimStart().toLowerCase();return{from:l,to:y,filter:!1,options:g.filter(x=>x.label.toLowerCase().startsWith(w))}}return g.length?{from:l,to:y,options:g}:null}function du(e="javascript",t=Rr()){let s,o=0,a=!1;const r=new Map,i=()=>{s==null||s.terminate(),s=void 0;for(const c of r.values())c([]);r.clear()},l=async c=>{if(a)return null;const u=uu(c,t,e);if(u||e==="python")return u;const d=c.matchBefore(/[\w$]*/);if(a||!d||!c.explicit&&d.from===d.to&&c.state.sliceDoc(c.pos-1,c.pos)!==".")return null;s||(s=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/assets/script-completion.worker-BCQQpdvq.js").href:new URL("assets/script-completion.worker-BCQQpdvq.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:ws&&ws.tagName.toUpperCase()==="SCRIPT"&&ws.src||new URL("connection-app-meta-CQ85y_6M.cjs",document.baseURI).href),{type:"module"}),s.onmessage=f=>{var h;(h=r.get(f.data.id))==null||h(f.data.options),r.delete(f.data.id)},s.onerror=i);const p=await new Promise(f=>{const h=++o;r.set(h,f),c.addEventListener("abort",()=>{r.delete(h),f([])},{onDocChange:!0}),s==null||s.postMessage({id:h,code:c.state.doc.toString(),position:c.pos,scope:t})});return c.aborted||!p.length?null:{from:d.from,options:p}};return[(e==="python"?ur.pythonLanguage:e==="typescript"?Wn.typescriptLanguage:Wn.javascriptLanguage).data.of({autocomplete:l}),Ys.ViewPlugin.define(()=>(a=!1,{destroy(){a=!0,i()}}))]}function pu(e){switch(e){case"javascript":return Wn.javascript();case"typescript":return Wn.javascript({typescript:!0});case"python":return ur.python()}}function uo(e){const t=ts(e.theme),{copied:s,copy:o}=ue.useCopyToClipboard(e.value),a=b.useMemo(()=>[...e.language?[pu(e.language)]:[],...e.language?[du(e.language,e.scriptScope)]:[],Ys.EditorView.theme(io)],[e.language,e.scriptScope]);return n.jsxs("div",{className:"w6w-code-editor","aria-label":e["aria-label"]??"Code editor",children:[n.jsx(dr,{value:e.value,onChange:e.onChange,extensions:a,placeholder:e.placeholder,readOnly:e.readOnly,theme:t,height:e.height,minHeight:e.minHeight??"160px",maxHeight:e.maxHeight,onCreateEditor:e.onCreateEditor,basicSetup:{lineNumbers:!0,foldGutter:!1,highlightActiveLine:!e.readOnly,bracketMatching:!0,closeBrackets:!0}}),e.copyable!==!1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${s?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void o(),children:s?n.jsx(ue.CheckGlyph,{}):n.jsx(ue.CopyGlyph,{})}),n.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:s?"Copied":""})]})]})}function fu(){const e=pr.jsonParseLinter();return t=>t.state.doc.toString().trim()===""?[]:e(t)}function tt(e){const t=ts(e.theme),{copied:s,copy:o}=ue.useCopyToClipboard(e.value),a=b.useMemo(()=>[pr.json(),...e.showDiagnostics===!1?[]:[na.linter(fu()),na.lintGutter()],Ys.EditorView.theme(io)],[e.showDiagnostics]);function r(i){var l,c,u,d;if(e.onChange(i),!(!e.onValidChange&&!e.onValidityChange)){if(i.trim().length===0){(l=e.onValidityChange)==null||l.call(e,{valid:!1,error:"Empty"});return}try{const p=JSON.parse(i);(c=e.onValidChange)==null||c.call(e,p),(u=e.onValidityChange)==null||u.call(e,{valid:!0})}catch(p){(d=e.onValidityChange)==null||d.call(e,{valid:!1,error:p.message})}}}return n.jsxs("div",{className:"w6w-json-editor","aria-label":e["aria-label"]??"JSON editor",children:[n.jsx(dr,{value:e.value,onChange:r,extensions:a,placeholder:e.placeholder,readOnly:e.readOnly,editable:!e.readOnly,theme:t,height:e.height,minHeight:e.minHeight??"240px",maxHeight:e.maxHeight,onCreateEditor:e.onCreateEditor,onBlur:e.onBlur,onFocus:e.onFocus,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!e.readOnly,autocompletion:!0,bracketMatching:!0,closeBrackets:!0}}),e.overlay,e.copyable!==!1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:`w6w-icon-btn w6w-copyable-btn${s?" is-copied":""}`,"aria-label":"Copy",onClick:()=>void o(),children:s?n.jsx(ue.CheckGlyph,{}):n.jsx(ue.CopyGlyph,{})}),n.jsx("span",{className:"w6w-copyable-status","aria-live":"polite",children:s?"Copied":""})]})]})}const hu={padding:"8px 8px 2px",fontSize:"0.75em",fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",opacity:.6,cursor:"default"};function mu(e){const t=[];for(const s of e){const o=t[t.length-1];o&&o.group===s.group?o.options.push(s):t.push({group:s.group,options:[s]})}return t}function $r(e,t,s){return e*t>.6*s}function Pr(e,t){const s=t.trim().toLowerCase();return s?e.filter(o=>{var a;return o.label.toLowerCase().includes(s)||o.value.toLowerCase().includes(s)||(((a=o.keywords)==null?void 0:a.toLowerCase().includes(s))??!1)}):e}const Na={display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"none",width:"1.25em",height:"1.25em",overflow:"hidden"},wu=240,Sa={display:"block",fontSize:"0.85em",opacity:.65,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},bu={position:"absolute",zIndex:50,left:0,right:0,top:"100%",overflowY:"auto",overscrollBehavior:"contain",margin:0,padding:4,listStyle:"none",background:"var(--w6w-panel)",color:"var(--w6w-text)",border:"1px solid var(--w6w-border)",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)"};function st({options:e,value:t,onChange:s,placeholder:o,disabled:a,"aria-label":r,mode:i="auto",forceSelection:l=!0,optionHeight:c=32,listMaxHeight:u=wu,className:d,onInputChange:p,emptyText:f="No matches",footer:h}){const m=i==="combobox"||i==="auto"&&$r(e.length,c,typeof window>"u"?0:window.innerHeight),y=b.useId(),g=e.find($=>$.value===t),w=(g==null?void 0:g.label)??(l?"":t),[x,v]=b.useState(w),[C,O]=b.useState(!1),[j,S]=b.useState(!1),[N,P]=b.useState(0),W=b.useRef(null);b.useEffect(()=>{v(w)},[w]);const T=b.useMemo(()=>j?Pr(e,x):e,[e,x,j]),F=b.useMemo(()=>({...bu,maxHeight:u}),[u]);if(!m)return n.jsxs("select",{className:d,value:t,disabled:a,"aria-label":r,onChange:$=>s($.target.value),children:[o!==void 0&&t===""&&n.jsx("option",{value:"",disabled:!0,children:o}),mu(e).map($=>$.group===void 0?$.options.map(I=>n.jsx("option",{value:I.value,children:I.label},I.value)):n.jsx("optgroup",{label:$.group,children:$.options.map(I=>n.jsx("option",{value:I.value,children:I.label},I.value))},`${$.group}-${$.options[0].value}`))]});const E=$=>`${y}-opt-${$}`,_=()=>{O(!1),S(!1)},R=$=>{v($.label),s($.value),_()},G=$=>{$.key==="ArrowDown"?($.preventDefault(),C?P(I=>Math.min(I+1,T.length-1)):O(!0)):$.key==="ArrowUp"?($.preventDefault(),C?P(I=>Math.max(I-1,0)):O(!0)):$.key==="Enter"?C&&T[N]?($.preventDefault(),R(T[N])):l||(x!==w&&s(x),_()):$.key==="Escape"&&(C&&$.stopPropagation(),v(w),_())},U=()=>{l?v(w):x!==w&&s(x),_()};return n.jsxs("div",{ref:W,className:"w6w-combobox",style:{position:"relative"},children:[(g==null?void 0:g.icon)!==void 0&&!j&&n.jsx("span",{"aria-hidden":"true",className:"w6w-combobox-icon",style:{...Na,position:"absolute",left:"0.6em",top:"50%",transform:"translateY(-50%)",pointerEvents:"none"},children:g.icon}),n.jsx("input",{type:"text",role:"combobox",className:d,style:(g==null?void 0:g.icon)!==void 0&&!j?{paddingLeft:"2.2em"}:void 0,value:x,disabled:a,placeholder:o,"aria-label":r,"aria-expanded":C,"aria-controls":`${y}-list`,"aria-autocomplete":"list","aria-activedescendant":C&&T[N]?E(N):void 0,autoComplete:"off",onFocus:()=>O(!0),onChange:$=>{v($.target.value),p==null||p($.target.value),S(!0),P(0),O(!0)},onKeyDown:G,onBlur:U}),C&&n.jsxs("div",{id:`${y}-list`,role:"listbox",tabIndex:-1,"aria-label":r,style:F,children:[T.map(($,I)=>{var V;return n.jsxs(b.Fragment,{children:[$.group!==void 0&&$.group!==((V=T[I-1])==null?void 0:V.group)&&n.jsx("div",{role:"presentation",className:"w6w-combobox-group",style:hu,children:$.group}),n.jsx("div",{id:E(I),role:"option",tabIndex:-1,"aria-selected":$.value===t,style:{padding:"6px 8px",cursor:"pointer",borderRadius:4,background:I===N?"var(--w6w-panel-2)":void 0},onMouseDown:K=>{K.preventDefault(),R($)},onMouseEnter:()=>P(I),children:$.icon!==void 0?n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"0.5em"},children:[n.jsx("span",{"aria-hidden":"true",className:"w6w-combobox-icon",style:Na,children:$.icon}),n.jsxs("span",{style:{minWidth:0,flex:1},children:[$.label,$.detail!==void 0&&n.jsx("span",{className:"w6w-combobox-detail",style:Sa,children:$.detail})]})]}):n.jsxs(n.Fragment,{children:[$.label,$.detail!==void 0&&n.jsx("span",{className:"w6w-combobox-detail",style:Sa,children:$.detail})]})})]},$.value)}),T.length===0&&n.jsx("div",{role:"presentation",style:{padding:"6px 8px",opacity:.6},children:f}),h!==void 0&&n.jsx("div",{role:"presentation",className:"w6w-combobox-footer",style:{padding:"6px 8px",opacity:.6,fontSize:"0.85em"},children:h})]})]})}function ns(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.source==="resolveFields"}function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.type==="expr"&&Array.isArray(e.parts)}function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.type==="secret"&&typeof e.ciphertext=="string"&&typeof e.iv=="string"}function Ca(e){return e.kind==="text"?{kind:"text",value:e.value??""}:e.kind==="expr"?{kind:"expr",expr:e.expr}:{kind:e.kind,ref:e.ref??""}}function Pn(e){const t=e.filter(o=>o.kind!=="text"||(o.value??"")!=="");if(t.length===0)return"";if(t.some(o=>o.kind==="render"))return{type:"expr",parts:t.map(Ca)};let s="";for(const o of t){if(o.kind==="text"){s+=o.value??"";continue}yu(s)%2===1&&(s+="\\"),s+=le.serializeTemplate([Ca(o)])}return s}function yu(e){let t=0;for(;t<e.length&&e[e.length-1-t]==="\\";)t+=1;return t}const _r={var:!0,vars:!0,state:!0,steps:!0,nodes:!0,trigger:!0,foreach:!0,loop:!0,inputs:!0,output:!0,secrets:!0,documents:!0,connections:!0,const:!0};Object.freeze(Object.keys(_r));const Aa=e=>Object.prototype.hasOwnProperty.call(_r,e),Ea=["state","var","vars"];function Fr(e){for(const t of Ea)if(e===t||e.startsWith(`${t}.`)){const s=e.slice(t.length);return[...new Set([e,...Ea.map(o=>o+s)])]}return[e]}function Ta(e){const t=e.indexOf(".");return t===-1?e:e.slice(0,t)}function yt(e){const t=le.parseTemplate(e,"editor",gu);return t.every(ss)?t:[{kind:"text",value:e}]}function ss(e){if(e.kind==="var"){const t=e.ref??"";return!le.hasRefusedChainToken(t)&&Aa(Ta(t))}if(e.kind==="expr"){const t=le.coalesceOperandRefs(e.expr);return t===null?!0:t.every(s=>Aa(Ta(s)))}return!0}const gu={isOurs:ss,backslash:"keep"},Lr={isOurs:ss,backslash:"strip"};function ht(e){return ot(e)?!0:typeof e=="string"&&e.includes("{{")&&yt(e).some(t=>t.kind!=="text")}function os(e){if(!e.includes("{{"))return null;const t=le.parseTemplate(e,"editor",Lr);return t.every(ss)&&(t.some(s=>s.kind!=="text")||t.map(s=>s.value??"").join("")!==e)?t:null}function xu(e){return e.includes("{{")?le.parseTemplate(e,"editor",Lr).map(t=>t.kind==="text"?t.value??"":le.serializeTemplate([t])).join(""):e}function Rs(e){if(bt(e))return{parts:[],sealed:e};if(ot(e))return{parts:e.parts.map(s=>({...s})),sealed:null};const t=typeof e=="string"?e:"";return{parts:t?yt(t):[],sealed:null}}function vu(e,t){let s="";for(const o of e)switch(o.kind){case"text":s+=xu(o.value??"");break;case"var":case"render":{const a=Fr(o.ref??"").find(r=>r in t);s+=a===void 0?"":t[a];break}case"secret":s+="•••";break;case"expr":s+=le.serializeTemplate([o]);break}return s}const Vt="var.",Oa="vars.",Is="documents.",$s="const.",Ns="connections.",Ps="state.";function Mr(e){return e==="state"||e==="vars"?"var":e.startsWith(Oa)?Vt+e.slice(Oa.length):e.startsWith(Ps)?Vt+e.slice(Ps.length):e}function ku(e){return e.startsWith(Ps)?3:e.startsWith(Vt)?2:1}function Dr(e){return e.rank>0?e.value:Object.fromEntries(Array.from(e.children,([t,s])=>[t,Dr(s)]))}function po(e,t,s,o){const a={children:new Map,rank:0},r={},i={},l={};for(const[w,x]of Object.entries(e??{})){const v=Mr(w);if(v.startsWith(Vt)){const C=v.slice(Vt.length),O=ku(w);let j=a;for(const S of C.split(".")){let N=j.children.get(S);N||(N={children:new Map,rank:0},j.children.set(S,N)),j=N}O>=j.rank&&(j.value=x,j.rank=O)}else v.startsWith(Is)?r[v.slice(Is.length)]=x:v.startsWith($s)?i[v.slice($s.length)]=x:v.startsWith(Ns)&&!v.slice(Ns.length).includes(".")&&(l[v.slice(Ns.length)]=x)}const c=Dr(a),u=(t==null?void 0:t.steps)??{},d=e??{},p=Object.hasOwn(d,"foreach.item"),f=typeof d["foreach.index"]=="number",h=t==null?void 0:t.foreach,m=h?{...h}:p||f?{...p?{item:d["foreach.item"]}:{},...f?{index:d["foreach.index"]}:{}}:void 0,y=Object.keys(d).filter(w=>w.startsWith("loop.")&&!w.slice(5).includes(".")),g=t!=null&&t.loop?{...t.loop}:y.length>0?Object.fromEntries(y.map(w=>[w.slice(5),d[w]])):void 0;return{...m?{foreach:m}:{},...g?{loop:g}:{},vars:c,state:c,documents:r,connections:l,constants:i,steps:u,nodes:u,trigger:(t==null?void 0:t.trigger)??{},flat:e??{},...s?{config:s}:{},...o?{meta:o}:{}}}function ju(e,t){const s=t.split(".");let o=e;for(const a of s){if(o===null||typeof o!="object")return{present:!1,value:void 0};if(!(a in o))return{present:!1,value:void 0};o=o[a]}return{present:!0,value:o}}const Nu=/^(?:nodes|steps)\.[^.]+\.(?:meta\.)?config(?:\.|$)/,Su=/^(?:nodes|steps)\.([^.]+)\.meta(?:\.|$)/;function Cu(e,t,s){var a;if(!t&&!s)return e;const o={...e};for(const r of new Set([...Object.keys(s??{}),...Object.keys(t??{})])){const i=t==null?void 0:t[r];o[r]={...e[r],meta:{...s==null?void 0:s[r],...(a=e[r])==null?void 0:a.meta,...i?{config:i}:{}},...i?{config:i}:{}}}return o}function qr(e,t){var f;const s=Mr(e);if(t.flat&&(s.startsWith(Vt)||s.startsWith(Is)||s.startsWith($s))){const h=Fr(e).find(m=>Object.hasOwn(t.flat,m));if(h!==void 0)return{status:"resolved",ref:e,value:t.flat[h]}}const{vars:o,constants:a,config:r,meta:i,...l}=t,c=Cu(t.nodes??t.steps,r,i),u={...l,var:o,...a?{const:a}:{},nodes:c,steps:c},d=ju(u,s);if(d.present)return{status:"resolved",ref:e,value:d.value};if(Nu.test(s))return{status:"at-run",ref:e};const p=(f=Su.exec(s))==null?void 0:f[1];return p!==void 0&&(i!=null&&i[p])?{status:"at-run",ref:e}:{status:"unresolved",ref:e}}function Ra(e,t){switch(e.kind){case"text":return{status:"resolved",value:e.value??""};case"var":return qr(e.ref??"",t);case"secret":return{status:"masked",ref:e.ref};case"expr":return{status:"not-evaluated"};case"render":return{status:"not-evaluated"};default:return{status:"resolved",value:void 0}}}function fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1&&"$"in e}function ho(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1&&"$expr"in e}function mo(e,t){if(bt(e))return[{status:"masked"}];if(ot(e))return e.parts.map(s=>Ra(s,t));if(typeof e=="string"){const s=os(e);if(s)return s.map(o=>Ra(o,t))}return fo(e)?[qr(String(e.$),t)]:ho(e)?[{status:"not-evaluated"}]:[{status:"resolved",value:e}]}function _s(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null||typeof e!="object")return!1;const s=Array.isArray(e),o=Array.isArray(t);if(s!==o)return!1;if(s){const c=e,u=t;return c.length===u.length&&c.every((d,p)=>_s(d,u[p]))}const a=e,r=t,i=Object.keys(a),l=Object.keys(r);return i.length===l.length&&i.every(c=>c in r&&_s(a[c],r[c]))}function Wr(e){switch(e.status){case"resolved":return e.value===void 0?"<not set>":e.value;case"unresolved":return`<unresolved: ${e.ref}>`;case"at-run":return`<resolved at run: ${e.ref}>`;case"not-evaluated":return"<not evaluated>";case"masked":return e.ref?`<masked: ${e.ref}>`:"<masked>"}}function Au(e){return e.status==="resolved"&&e.value!==void 0?typeof e.value=="string"?e.value:JSON.stringify(e.value):String(Wr(e))}function Eu(e){return e.length===1?Wr(e[0]):e.map(Au).join("")}function wn(e,t){return Eu(mo(e,t))}function Tu(e,t){const s={};for(const o of e)s[o.key||"(no key)"]=wn(o.value,t);return s}const as=b.forwardRef(function(t,s){const{label:o,children:a,icon:r,iconSize:i,title:l,onClick:c,disabled:u,className:d,danger:p,...f}=t,h=a??(r?n.jsx(ue.Icon,{name:r,size:i??16}):null),m=Object.fromEntries(Object.entries(f).filter(([y])=>y.startsWith("data-")));return n.jsx("button",{ref:s,type:"button",className:["w6w-icon-button",p?"w6w-icon-button-danger":"",d??""].filter(Boolean).join(" "),title:l??o,"aria-label":o,"aria-pressed":f["aria-pressed"],"aria-expanded":f["aria-expanded"],"aria-controls":f["aria-controls"],"aria-haspopup":f["aria-haspopup"],disabled:u,onClick:c,...m,children:h})});as.displayName="IconButton";const Ou={default:"",wide:" w6w-modal-wide",xl:" w6w-modal-xl",full:" w6w-modal-full",fullscreen:" w6w-modal-fullscreen"};function Re({title:e,ariaLabel:t,onClose:s,children:o,size:a="default",titleIcon:r,subtitle:i,headerRight:l}){const c=b.useRef(null),u=b.useRef(null);return b.useEffect(()=>()=>{var d;(d=u.current)!=null&&d.isConnected&&u.current.focus({preventScroll:!0})},[]),b.useEffect(()=>{const d=c.current;if(!d)return;d.open||(u.current=document.activeElement,d.showModal());const p=h=>{h.preventDefault(),s()},f=h=>{if(h.target!==d)return;const m=d.getBoundingClientRect();(h.clientX<m.left||h.clientX>m.right||h.clientY<m.top||h.clientY>m.bottom)&&s()};return d.addEventListener("cancel",p),d.addEventListener("click",f),()=>{d.removeEventListener("cancel",p),d.removeEventListener("click",f)}},[s]),n.jsx("div",{className:"w6w-modal-backdrop",children:n.jsxs("dialog",{ref:c,className:`w6w-modal${Ou[a]}`,"aria-label":t??(typeof e=="string"?e:void 0),children:[n.jsxs("div",{className:"w6w-modal-header",children:[n.jsxs("h3",{className:"w6w-modal-title",children:[r,n.jsx("span",{children:e}),i&&n.jsx("span",{className:"w6w-modal-subtitle",children:i})]}),l]}),o]})})}const wo=new Set(["nodes","steps","state","var","vars","const","inputs","output","trigger","foreach","loop","documents","connections"]),Ru=/[=<>]|!=|&&|\|\||\?\?/,_n=e=>Ru.test(e)||/^\s*\(*\s*!/.test(e),Fs=e=>le.expressionReferences(e).some(_n);function Iu(e,t){var r,i,l;const[s,...o]=e.split(".");if(s==="secrets")throw new Error("Secrets can be inserted into text, but cannot be used in comparisons.");if(wo.has(s))return e;const a=[...(r=t.steps)!=null&&r.some(c=>c.id===s)?[`nodes.${s}.output`]:[],...(i=t.vars)!=null&&i.includes(s)?[`var.${s}`]:[],...(l=t.constants)!=null&&l.includes(s)?[`const.${s}`]:[]];if(a.length>1)throw new Error(`“${s}” is ambiguous. Select the field from the sources.`);if(a.length===0)throw new Error(`Unknown field “${s}”. Select a source, or put text values in quotes.`);return[a[0],...o].join(".")}function ln(e,t){var u,d,p,f,h;const s={parts:e,error:null},o=e.flatMap(m=>m.kind==="text"?yt(m.value??""):[m]);if(o.some(m=>m.kind==="render"))return s;if(o.some(Ur))return{parts:o,error:$u};if(o.some(Pu))return s;if(o.length===1&&o[0].kind==="expr"&&!Fs(o[0].expr))return{parts:o,error:null};let a=o.map(m=>{if(m.kind==="text")return m.value??"";if(m.kind==="secret")return`{{ secrets.${m.ref??""} }}`;if(m.kind==="expr"){if(Fs(m.expr)){const g=le.serializeTemplate([m]);if(!g.startsWith("{{ ="))return`(${g.slice(2,-2).trim()})`}const y=le.formatReadableExpression(m.expr);return y===null?le.serializeTemplate([m]):`(${y})`}return _n(m.ref??"")?m.ref??"":`{{ ${m.ref??""} }}`}).join("").trim();if(!_n(a))return s;const r=/^\{\{([^{}]+)\}\}$/.exec(a);r&&_n(r[1])&&(a=r[1].trim());const i=a.replace(/^[\s(!]+/,""),l=(u=/^(?:\{\{\s*)?([A-Za-z_$][\w$-]*)/.exec(i))==null?void 0:u[1],c=i.startsWith("{{")||l!==void 0&&(wo.has(l)||l==="secrets"||((d=t.steps)==null?void 0:d.some(m=>m.id===l))||((p=t.vars)==null?void 0:p.includes(l))||((f=t.constants)==null?void 0:f.includes(l)));if(!c&&!/^(?:["']|-?\d|true\b|false\b|null\b)/.test(i))return s;if(c&&!/^\s*\(*\s*!/.test(a)){const m=(h=/^(?:\{\{[^{}]+\}\}|[A-Za-z_$][\w$-]*(?:\.[\w$-]+)*)/.exec(i))==null?void 0:h[0];if(m){const y=i.slice(m.length).replace(/^[\s)]+/,"");if(!/^(?:[=<>(]|!=|&&|\|\||\?\?)/.test(y)||/^<\/?[A-Za-z][^>]*>/.test(y))return s}}try{return{parts:[{kind:"expr",expr:le.parseReadableExpression(a,y=>Iu(y,t))}],error:null}}catch(m){return{parts:o,error:m instanceof Error?m.message:"Check the expression."}}}const $u="The JSONLogic after “=” is not valid JSON. Check its quotes, brackets and commas.";function Ur(e){return e.kind==="expr"&&typeof e.expr=="string"}function Pu(e){return e.kind==="expr"&&e.expr!==null&&typeof e.expr=="object"&&!Fs(e.expr)&&le.formatReadableExpression(e.expr)===null}function _u(e){return[...new Set(e.flatMap(t=>t.kind==="expr"?le.expressionReferences(t.expr):(t.kind==="var"||t.kind==="render")&&t.ref?[t.ref]:[]))]}function Fu(e){return e.replace(/^(?:vars|state)(?=\.|$)/,"var").replace(/^steps(?=\.|$)/,"nodes")}function Lu(e){const t=Object.create(null);for(const[s,o]of Object.entries(e).sort(([a],[r])=>a.split(".").length-r.split(".").length)){const a=Fu(s).split(".");if(!wo.has(a[0])||a.some(i=>["__proto__","constructor","prototype"].includes(i)))continue;let r=t;for(const i of a.slice(0,-1)){const l=r[i],c=l&&typeof l=="object"?{...l}:{};r[i]=c,r=c}r[a[a.length-1]]=o}return t.steps=t.nodes,t.vars=t.var,t.state=t.var,t}function Mu(e,t={},s={}){const o={...t};for(const[i,l]of Object.entries(s))try{o[i]=JSON.parse(l)}catch{o[i]=l}const a=Lu(o),r=Object.fromEntries(Object.entries(o).map(([i,l])=>[i,typeof l=="string"?l:JSON.stringify(l)]));return e.map(i=>{if(i.kind!=="expr"||Ur(i))return vu([i],r);if(le.expressionReferences(i.expr).some(u=>!u||u.split(".")[0]==="secrets"))return"••••";const c=le.evaluate(i.expr,a);return typeof c=="string"?c:JSON.stringify(c)??""}).join("")}const Du=/^(?:nodes|steps)\.([^.]+)\.output(?:\.(.+))?$/,qu=/^(?:nodes|steps)\.([^.]+)\.meta\.(app|version|action|connectionId)$/,It=e=>{if(e.startsWith("var."))return e.slice(4);if(e.startsWith("vars."))return e.slice(5);if(e.startsWith("const."))return e.slice(6);const t=Du.exec(e);if(t)return t[2]?`${t[1]}.${t[2]}`:t[1];const s=qu.exec(e);return s?`${s[1]} meta · ${s[2]}`:e};function Wu(e){if(e===null||typeof e!="object"||Array.isArray(e))return;const t=Object.keys(e);if(t.length!==1||t[0]!=="var")return;const s=e.var;return typeof s=="string"?s:void 0}function Uu(e){const t=e.op==="or"?"||":"??",s=e.operands.map(o=>{const a=Wu(o);return a!==void 0?It(a):JSON.stringify(o)}).join(` ${t} `);return s.length>40?`${s.slice(0,40)}…`:s}const Bu=/[.{}]/;function Bt(e){return e===""||e!==e.trim()?!1:!Bu.test(e)}function Rn(e){return e.split(".").every(Bt)}function Hu(e){const t=new Set(e.filter(s=>s.path).map(s=>s.key));return e.map(s=>{if(!s.path)return{field:s,depth:0,name:s.key,parent:null};const o=s.key.split(".");let a=0,r=0;for(let l=1;l<o.length;l++)t.has(o.slice(0,l).join("."))&&(a++,r=l);const i=r>0?o.slice(0,r).join("."):null;return{field:s,depth:a,name:o.slice(r).join("."),parent:i}})}function Ia(e,t){const s=Hu(e),o=new Map(s.map(i=>[i.field.key,i.parent])),a=new Map;for(const i of s)i.parent!==null&&a.set(i.parent,(a.get(i.parent)??0)+1);const r=i=>{const l=o.get(i)??null;return l===null||t(l)&&r(l)};return s.filter(i=>r(i.field.key)).map(({field:i,depth:l,name:c})=>({field:i,depth:l,name:c,children:a.get(i.key)??0}))}function bn(e,t,{renderToggle:s}={}){const o=e.createElement("span");o.contentEditable="false",o.className=`w6w-expr-chip w6w-expr-chip-${t.kind}`,o.setAttribute("data-kind",t.kind);const a=e.createElement("span");a.className="w6w-expr-chip-sigil";const r=e.createElement("span");if(r.className="w6w-expr-chip-label",t.kind==="var")o.setAttribute("data-ref",t.ref??""),a.textContent="◆",r.textContent=It(t.ref??""),o.title=`Variable: ${t.ref??""}`;else if(t.kind==="render")o.setAttribute("data-ref",t.ref??""),a.textContent="▤",r.textContent=It(t.ref??""),o.title=`Render as template: ${t.ref??""}`;else if(t.kind==="secret")o.setAttribute("data-ref",t.ref??""),a.textContent="🔒",r.textContent=t.ref??"",o.title=`Secret: ${t.ref??""}`;else{const l=typeof t.expr=="string"?t.expr:JSON.stringify(t.expr??"");o.setAttribute("data-expr",l),a.textContent="ƒ";const c=le.parseCoalesceChain(t.expr);if(c)r.textContent=Uu(c),o.title=`Expression: ${le.serializeTemplate([t])}`;else{const u=le.formatReadableExpression(t.expr,It);r.textContent=u??(l.length>24?`${l.slice(0,24)}…`:l||"expr"),o.title=`Expression: ${u??l}`}}if(o.append(a,r),(t.kind==="var"||t.kind==="render")&&s){const l=e.createElement("span");l.className="w6w-expr-chip-toggle",l.setAttribute("data-render-toggle","1"),l.setAttribute("role","button");const c=t.kind==="render"?"Stop rendering as a template":"Render this as a template";l.setAttribute("aria-label",c),l.title=c,l.textContent="⇄",o.append(l)}const i=e.createElement("span");return i.className="w6w-expr-chip-x",i.setAttribute("data-x","1"),i.setAttribute("role","button"),i.setAttribute("aria-label","Remove"),i.textContent="×",o.append(i),o}const Br=new Set(["div","p"]);function Hr(e){const t=e.getAttribute("data-kind");if(t==="var"||t==="secret"||t==="render")return{kind:t,ref:e.getAttribute("data-ref")??""};if(t==="expr"){const s=e.getAttribute("data-expr")??"";let o=s;try{o=JSON.parse(s)}catch{o=s}return{kind:"expr",expr:o}}return null}function cn(e){const t=[],s=r=>{if(!r)return;const i=t[t.length-1];i&&i.kind==="text"?i.value=(i.value??"")+r:t.push({kind:"text",value:r})},o=(r,i)=>{if(r.nodeType===Node.TEXT_NODE){s(r.textContent??"");return}if(r.nodeType!==Node.ELEMENT_NODE)return;const l=r,c=Hr(l);if(c){t.push(c);return}const u=(l.tagName??"").toLowerCase();if(u==="br"){i||s(`
|
|
6
6
|
`);return}const d=Br.has(u);d&&t.length>0&&s(`
|
|
7
7
|
`),a(l,d)},a=(r,i)=>{const l=Array.from(r.childNodes);l.forEach((c,u)=>o(c,i&&u===l.length-1))};return a(e,!0),t}const zr=e=>!!e&&(e.tagName??"").toLowerCase()==="br";function Vr(e){zr(e.lastChild)||e.appendChild(e.ownerDocument.createElement("br"))}function zu(e){const t=e.ownerDocument.getSelection(),s=t!=null&&t.rangeCount?t.getRangeAt(0):null;if(!s||!e.contains(s.endContainer))return e;let o=s.endContainer;for(;o&&o!==e;){if(o.nodeType===Node.ELEMENT_NODE){const a=o;if(Br.has((a.tagName??"").toLowerCase()))return a}o=o.parentNode}return e}function bo(e){Vr(zu(e))}const Jr=e=>e.getAttribute("aria-multiline")!=="false";function Kr(e,t,s){var r;const o=e.ownerDocument;e.textContent="";for(const i of t)i.kind==="text"?i.value&&e.appendChild(o.createTextNode(i.value)):e.appendChild(bn(o,i,s));const a=t[t.length-1];(a==null?void 0:a.kind)==="text"&&((r=a.value)!=null&&r.endsWith(`
|
|
8
8
|
`))&&Jr(e)&&Vr(e)}function yo(e){const t=e.ownerDocument.getSelection();if(!t)return;const s=e.ownerDocument.createRange();s.selectNodeContents(e),s.collapse(!1),t.removeAllRanges(),t.addRange(s)}function Vn(e,t){const s=e.ownerDocument,o=s.getSelection(),a=o!=null&&o.rangeCount?o.getRangeAt(0):null;if(a&&e.contains(a.commonAncestorContainer)){a.deleteContents(),a.insertNode(t);const r=s.createRange();r.setStartAfter(t),r.collapse(!0),o==null||o.removeAllRanges(),o==null||o.addRange(r)}else zr(e.lastChild)?e.insertBefore(t,e.lastChild):e.appendChild(t),yo(e);e.focus()}function Gr(e,t,s={}){const o=Jr(e),a=o?t.replace(/\r\n?/g,`
|
|
@@ -26,4 +26,4 @@ return input`,yd=["// Read `input` (bound under Input), plus `vars`, `consts` an
|
|
|
26
26
|
`)){const a=Ah.exec(o),r=s.createElement(a?`h${a[1].length}`:"div"),i=a?a[2]:o;let l=0;for(const c of i.matchAll(Eh)){c.index>l&&r.append(s.createTextNode(i.slice(l,c.index)));const u=s.createElement("strong");u.textContent=c[1],r.append(u),l=c.index+c[0].length}l<i.length&&r.append(s.createTextNode(i.slice(l))),r.firstChild||r.append(s.createElement("br")),e.append(r)}}function Oh(e){var o;const t=(o=e.style)==null?void 0:o.fontWeight;if(!t)return;if(t==="bold"||t==="bolder")return!0;const s=Number(t);return Number.isFinite(s)?s>=600:!1}function Rh(e){const t=[];for(const s of e){const o=t[t.length-1];o&&o.bold===s.bold?o.text+=s.text:t.push({...s})}return t.map(({text:s,bold:o})=>{const a=s.trim();if(!o||!a)return s;const r=s.slice(0,s.indexOf(a)),i=s.slice(r.length+a.length);return`${r}**${a}**${i}`}).join("")}function Ih(e){const t=[];let s=null;const o=i=>(s={level:i,runs:[]},t.push(s),s),a=(i,l,c)=>{if(i.nodeType===3){const y=(i.textContent??"").replace(/ /g," ").replace(/\n/g,"");y&&(s??o(l)).runs.push({text:y,bold:c});return}if(i.nodeType!==1)return;const u=i,d=u.tagName.toLowerCase();if(d==="br"){s||o(l),s=null;return}const p=/^h([1-6])$/.exec(d),f=p||["div","p","li","ul","ol","blockquote","pre"].includes(d);f&&(s=null);const h=p?Number(p[1]):l,m=d==="b"||d==="strong"?!0:Oh(u)??c;for(const y of u.childNodes)a(y,h,m);f&&(s=null)};for(const i of e.childNodes)a(i,0,!1);const r=t.map(i=>{const l=Rh(i.runs);return i.level>0?`${"#".repeat(i.level)} ${l.trimStart()}`:l});for(;r.length&&r[r.length-1].trim()==="";)r.pop();return r.join(`
|
|
27
27
|
`)}function $h(e){return e.replace(/([^\n])\n(?=[^\n])/g,`$1
|
|
28
28
|
`)}const Ph=-2,_h=-1,lr=1e3,Fh=["#facc15","#fb923c","#f87171","#f472b6","#a78bfa","#60a5fa","#2dd4bf","#4ade80","#9ca3af"],Lh=[{level:1,label:"Title"},{level:2,label:"Heading"},{level:3,label:"Subheading"},{level:0,label:"Body"}],Mh=80,Dh=48,cr=10,qh=4,As=e=>e.stopPropagation();function Wh(e){const t=e.ownerDocument.getSelection();if(!t)return;const s=e.ownerDocument.createRange();s.selectNodeContents(e),t.removeAllRanges(),t.addRange(s)}function Uh(e){const t=e.ownerDocument.getSelection();if(!t)return;const s=e.ownerDocument.createRange();s.selectNodeContents(e),s.collapse(!1),t.removeAllRanges(),t.addRange(s)}function Ol({canvas:e,className:t,viewport:s,readOnly:o,zoom:a=1,onChange:r,onSectionDrop:i,onRequestDelete:l}){const[c,u]=b.useState({}),[d,p]=b.useState(null),[f,h]=b.useState(null),[m,y]=b.useState(null),[g,w]=b.useState(null),x=b.useRef(null),v=b.useRef(null),C=b.useRef(null);if(b.useEffect(()=>{if(!d&&!f)return;const A=d?`[data-note-id="${d}"], [data-note-toolbar="${d}"]`:`[data-section-label="${f}"], [data-section-toolbar="${f}"]`,z=Q=>{var Ce,ye;const ie=Q.target;if((Ce=ie==null?void 0:ie.closest)!=null&&Ce.call(ie,A))return;const X=document.activeElement;(ye=X==null?void 0:X.closest)!=null&&ye.call(X,"[data-section-toolbar]")&&X.blur(),p(null),h(null),w(null)};return window.addEventListener("pointerdown",z,!0),()=>window.removeEventListener("pointerdown",z,!0)},[d,f]),!s)return null;const O=!o&&!!r,j=e.sections??[],S=e.notes??[],N=A=>c[A.id]??{x:A.position.x,y:A.position.y,w:A.size.width,h:A.size.height},P=A=>{const z=N(A);return{left:z.x,top:z.y,width:z.w,height:z.h,"--w6w-canvas-color":A.color}},W=(A,z)=>r==null?void 0:r({...e,notes:S.map(Q=>Q.id===A?{...Q,...z}:Q)}),T=(A,z)=>r==null?void 0:r({...e,sections:j.map(Q=>Q.id===A?{...Q,...z}:Q)}),F=A=>{const z=v.current,Q=S.find(X=>X.id===A);if(!(z!=null&&z.isConnected)||!Q)return;const ie=Ih(z);ie!==Q.content&&W(A,{content:ie})},E=A=>{h(null),p(A)},_=A=>{p(null),h(A)},R=(A,z)=>{C.current=z??null,E(A),y(A),w(null)},G=A=>z=>{if(!z||z.dataset.ready==="1")return;z.dataset.ready="1",v.current=z,Th(z,A.content),z.focus();const Q=C.current;C.current=null,Q?(Wh(z),Q(),F(A.id)):Uh(z)},U=(A,z,Q)=>{var X;w(null);const ie=()=>document.execCommand(z,!1,Q);m===A&&((X=v.current)!=null&&X.isConnected)?(ie(),F(A)):R(A,ie)},$=A=>A.mode==="move"?{...A.base,x:A.base.x+A.dx,y:A.base.y+A.dy}:{...A.base,w:Math.max(Mh,A.base.w+A.dx),h:Math.max(Dh,A.base.h+A.dy)},I=(A,z,Q,ie)=>{if(!O||A.button!==0)return;A.stopPropagation(),A.preventDefault();const X={kind:Q,id:z.id,mode:ie,sx:A.clientX,sy:A.clientY,base:N(z),dx:0,dy:0};x.current=X;const Ce=xe=>{X.dx=(xe.clientX-X.sx)/(a||1),X.dy=(xe.clientY-X.sy)/(a||1),u(ve=>({...ve,[X.id]:$(X)}))},ye=()=>{if(window.removeEventListener("pointermove",Ce),window.removeEventListener("pointerup",ye),x.current=null,u(ke=>{const{[X.id]:de,...D}=ke;return D}),X.dx===0&&X.dy===0)return;const xe=$(X),ve={position:{x:xe.x,y:xe.y},size:{width:xe.w,height:xe.h}};X.kind==="section"&&X.mode==="move"&&i?i(X.id,{dx:X.dx,dy:X.dy}):X.kind==="note"?W(X.id,ve):T(X.id,ve)};window.addEventListener("pointermove",Ce),window.addEventListener("pointerup",ye)},V=t?` ${t}`:"",K="nopan nodrag nowheel",te=O?S.find(A=>A.id===d):void 0,H=O?j.find(A=>A.id===f):void 0,Y=a||1,J=A=>{const z=N(A);return{left:z.x+z.w/2,top:z.y,transform:`translate(-50%, calc(-100% - ${cr/Y}px)) scale(${1/Y})`,transformOrigin:"50% 100%","--w6w-canvas-color":A.color}},M=(A,z)=>{const Q=N(A);return{left:Q.x,top:Q.y,transform:`translate(0, calc(-100% - ${z/Y}px)) scale(${1/Y})`,transformOrigin:"0 100%","--w6w-canvas-color":A.color}},ee=(A,z,Q,ie)=>n.jsxs("div",{className:"w6w-note-menu w6w-note-menu-colors",role:"menu",children:[Fh.map(X=>n.jsx("button",{type:"button",role:"menuitemradio","aria-checked":X===A,"aria-label":`Colour ${X}`,title:X,className:`w6w-note-swatch-btn${X===A?" active":""}`,style:{"--w6w-canvas-color":X},"data-testid":`${Q}-option`,"data-color":X,onClick:()=>{w(null),X!==A&&ie(X)}},X)),n.jsx("label",{className:"w6w-note-swatch-btn w6w-note-swatch-custom",title:"Custom",children:n.jsx("input",{type:"color","aria-label":`Custom ${z} colour`,"data-testid":`${Q}-input`,value:A,onChange:X=>ie(X.currentTarget.value)})})]}),Z=A=>{A.target.closest("input")||A.preventDefault()};return Un.createPortal(n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`w6w-canvas-layer w6w-canvas-sections${V}`,style:{zIndex:Ph},"data-testid":"w6w-canvas-sections",children:[j.map(A=>n.jsx("div",{className:`w6w-canvas-section${f===A.id?" selected":""}`,style:P(A),"data-section-id":A.id,"data-testid":"section",children:O&&n.jsx("div",{className:`w6w-note-resize ${K}`,"data-testid":"section-resize",onPointerDown:z=>I(z,A,"section","resize")})},A.id)),j.map(A=>(H==null?void 0:H.id)===A.id?null:n.jsx("div",{className:`w6w-canvas-section-title${O?` editable ${K}`:""}`,style:M(A,qh),"data-section-label":A.id,"data-testid":"section-label",title:O?"Click to edit · drag to move":void 0,onPointerDown:O?z=>{_(A.id),I(z,A,"section","move")}:void 0,children:A.title||(O?"Untitled section":"")},A.id))]}),n.jsx("div",{className:`w6w-canvas-layer w6w-canvas-notes${V}`,style:{zIndex:_h},"data-testid":"w6w-canvas-notes",children:S.map(A=>{const z=O&&m===A.id;return n.jsxs("div",{className:`w6w-canvas-note${d===A.id?" selected":""}`,style:P(A),"data-note-id":A.id,"data-testid":"note",children:[z?n.jsx("div",{ref:G(A),className:`w6w-canvas-note-body w6w-canvas-note-editor ${K}`,contentEditable:!0,suppressContentEditableWarning:!0,role:"textbox",tabIndex:0,"aria-multiline":"true","aria-label":"Note content","data-testid":"note-content",onPointerDown:As,onBlur:()=>{F(A.id),v.current=null,y(null)},onKeyDown:Q=>{Q.key==="Escape"&&Q.currentTarget.blur()},onPaste:Q=>{Q.preventDefault(),document.execCommand("insertText",!1,Q.clipboardData.getData("text/plain"))}},"editor"):n.jsx("div",{className:`w6w-canvas-note-body ${K}`,"data-testid":"note-view",style:O?{cursor:"grab",touchAction:"none"}:void 0,onPointerDown:O?Q=>{E(A.id),I(Q,A,"note","move")}:void 0,onDoubleClick:O?()=>R(A.id):void 0,children:A.content.trim()?n.jsx(Ao,{content:$h(A.content)}):O&&n.jsx("span",{className:"w6w-canvas-note-empty",children:"Double-click to write"})},"view"),O&&n.jsx("div",{className:`w6w-note-resize ${K}`,"data-testid":"note-resize",onPointerDown:Q=>I(Q,A,"note","resize")})]},A.id)})}),H&&n.jsx("div",{className:`w6w-canvas-layer${V}`,style:{zIndex:lr},"data-testid":"w6w-canvas-overlay",children:n.jsxs("div",{className:`w6w-note-toolbar w6w-section-toolbar ${K}`,role:"toolbar","aria-label":"Section","data-testid":"section-toolbar","data-section-toolbar":H.id,style:M(H,cr),onPointerDown:As,onMouseDown:Z,children:[n.jsx("button",{type:"button",className:"w6w-icon-btn w6w-note-grip","aria-label":"Move section",title:"Drag to move","data-testid":"section-drag",onPointerDown:A=>I(A,H,"section","move"),children:n.jsx(ue.Icon,{name:"grip"})}),n.jsx("input",{type:"text",className:"w6w-section-title-input","aria-label":"Section title",placeholder:"Untitled section","data-testid":"section-title",defaultValue:H.title,size:Math.max(8,Math.min(32,H.title.length+1)),onBlur:A=>{const z=A.currentTarget.value;z!==H.title&&T(H.id,{title:z})},onKeyDown:A=>{(A.key==="Enter"||A.key==="Escape")&&A.currentTarget.blur()}},`${H.id}:${H.title}`),n.jsx("span",{className:"w6w-note-toolbar-sep"}),n.jsxs("div",{className:"w6w-note-toolbar-group",children:[n.jsxs("button",{type:"button",className:`w6w-icon-btn${g==="color"?" active":""}`,"aria-label":"Section colour","aria-expanded":g==="color",title:"Colour","data-testid":"section-color",onClick:()=>w(g==="color"?null:"color"),children:[n.jsx("span",{className:"w6w-note-swatch"}),n.jsx(ue.Icon,{name:"chevron-down",size:12})]}),g==="color"&&ee(H.color,"section","section-color",A=>T(H.id,{color:A}))]}),n.jsx("span",{className:"w6w-note-toolbar-sep"}),n.jsx("button",{type:"button",className:"w6w-icon-btn w6w-note-delete","aria-label":"Delete section",title:"Delete section","data-testid":"section-delete",onClick:()=>{w(null),l==null||l("section",H.id)},children:n.jsx(ue.Icon,{name:"trash"})})]})}),te&&n.jsx("div",{className:`w6w-canvas-layer${V}`,style:{zIndex:lr},"data-testid":"w6w-canvas-overlay",children:n.jsxs("div",{className:`w6w-note-toolbar ${K}`,role:"toolbar","aria-label":"Note","data-testid":"note-toolbar","data-note-toolbar":te.id,style:J(te),onPointerDown:As,onMouseDown:Z,children:[n.jsx("button",{type:"button",className:"w6w-icon-btn w6w-note-grip","aria-label":"Move note",title:"Drag to move","data-testid":"note-drag",onPointerDown:A=>I(A,te,"note","move"),children:n.jsx(ue.Icon,{name:"grip"})}),n.jsx("span",{className:"w6w-note-toolbar-sep"}),n.jsxs("div",{className:"w6w-note-toolbar-group",children:[n.jsxs("button",{type:"button",className:`w6w-icon-btn${g==="color"?" active":""}`,"aria-label":"Note colour","aria-expanded":g==="color",title:"Colour","data-testid":"note-color",onClick:()=>w(g==="color"?null:"color"),children:[n.jsx("span",{className:"w6w-note-swatch"}),n.jsx(ue.Icon,{name:"chevron-down",size:12})]}),g==="color"&&ee(te.color,"note","note-color",A=>W(te.id,{color:A}))]}),n.jsx("span",{className:"w6w-note-toolbar-sep"}),n.jsxs("div",{className:"w6w-note-toolbar-group",children:[n.jsxs("button",{type:"button",className:`w6w-icon-btn w6w-note-size-btn${g==="size"?" active":""}`,"aria-label":"Text size","aria-expanded":g==="size",title:"Text size","data-testid":"note-size",onClick:()=>w(g==="size"?null:"size"),children:["Aa",n.jsx(ue.Icon,{name:"chevron-down",size:12})]}),g==="size"&&n.jsx("div",{className:"w6w-note-menu w6w-note-menu-sizes",role:"menu",children:Lh.map(A=>n.jsx("button",{type:"button",role:"menuitem",className:`w6w-note-menu-item w6w-note-size-${A.level}`,"data-testid":`note-size-${A.level}`,onClick:()=>U(te.id,"formatBlock",A.level?`<h${A.level}>`:"<div>"),children:A.label},A.level))})]}),n.jsx("button",{type:"button",className:"w6w-icon-btn","aria-label":"Bold",title:"Bold","data-testid":"note-bold",onClick:()=>U(te.id,"bold"),children:n.jsx(ue.Icon,{name:"bold"})}),n.jsx("span",{className:"w6w-note-toolbar-sep"}),n.jsx("button",{type:"button",className:"w6w-icon-btn w6w-note-delete","aria-label":"Delete note",title:"Delete note","data-testid":"note-delete",onClick:()=>{w(null),l==null||l("note",te.id)},children:n.jsx(ue.Icon,{name:"trash"})})]})})]}),s)}function Bh(e){const t=Es.useStore(o=>{var a;return((a=o.domNode)==null?void 0:a.querySelector(".react-flow__viewport"))??null}),s=Es.useStore(o=>o.transform[2]);return n.jsx(Ol,{...e,zoom:e.zoom??s,viewport:t})}function Hh(e){return e.viewport!==void 0?n.jsx(Ol,{...e,viewport:e.viewport}):n.jsx(Bh,{...e})}function zh({title:e,message:t,onConfirm:s,onClose:o,confirmLabel:a="Confirm",cancelLabel:r="Cancel",destructive:i=!0,pending:l=!1,autoFocusConfirm:c=!1,children:u}){const d=b.useRef(null);return b.useEffect(()=>{var p;c&&((p=d.current)==null||p.focus())},[c]),n.jsxs(Re,{title:e,onClose:()=>{l||o()},children:[n.jsxs("div",{className:"w6w-modal-body",children:[n.jsx("p",{className:"w6w-muted w6w-small",children:t}),u]}),n.jsxs("div",{className:"w6w-modal-actions",children:[n.jsx("button",{type:"button",className:"w6w-btn w6w-btn-ghost",onClick:o,disabled:l,children:r}),n.jsx("button",{ref:d,type:"button",className:i?"w6w-btn w6w-btn-danger":"w6w-btn",onClick:s,disabled:l,children:a})]})]})}function vn(e){if(!e||typeof e!="object")return null;switch(e.type){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":{const t={};for(const[s,o]of Object.entries(e.fields??{}))t[s]=vn(o);return t}case"array":return e.items?[vn(e.items)]:[];default:return null}}function Vh(e){const t={};for(const s of e??[])s&&typeof s.nodeId=="string"&&s.nodeId!==""&&(t[s.nodeId]=s);return t}function fs(e){return e.sampleOmitted!==!0&&"sample"in e&&e.sample!==void 0}function hs(e,t){if(!t)return!1;const s=Date.parse(e.updatedAt),o=Date.parse(t);return Number.isFinite(s)&&Number.isFinite(o)&&s>o}function Rl(e,t,s,o){const a=t[e],r=s[e];return a!==void 0&&(!r||!hs(r,o==null?void 0:o[e]))||!r?a:fs(r)?r.sample:vn(r.shape)}function Jh(e,t,s){const o={};for(const a of new Set([...Object.keys(e),...Object.keys(t)])){const r=Rl(a,e,t,s);r!==void 0&&(o[a]=r)}return o}function Kh(e,t,s){const o={...e};for(const[a,r]of Object.entries(t))fs(r)&&(e[a]===void 0||hs(r,s==null?void 0:s[a]))&&(o[a]=r.sample);return o}function Gh(e,t,s){const o={...e},a={};for(const[r,i]of Object.entries(t))e[r]!==void 0&&!hs(i,s==null?void 0:s[r])||(delete o[r],a[r]=fs(i)?i.sample:vn(i.shape));return{fresh:o,persisted:a}}function Yh(e,t,s){const o={...e},a={};for(const[r,i]of Object.entries(t))fs(i)&&(e[r]===void 0||hs(i,s==null?void 0:s[r]))&&(delete o[r],a[r]=i.sample);return{fresh:o,persisted:a}}function Xh(e,t){if(e.app)return e.app;if(e.app!==null)return t.get(e.appId)}function Qh(e){const t=new Set;for(const s of e)s.app===void 0&&t.add(s.appId);return[...t]}exports.AddConnectionModal=ko;exports.AnchoredFlyout=Bi;exports.ApiCallsPanel=Yi;exports.AppConnectionForm=Jd;exports.AppIcon=Mt;exports.AppPicker=ft;exports.AuthFieldsForm=Ln;exports.AuthGuide=si;exports.CALL_APP=jn;exports.CHOICE_FIELD_TYPES=Zn;exports.CONDITION_OPS=hr;exports.CONTROL_APP=Se;exports.CallTargetForm=Tl;exports.CanvasLayer=Hh;exports.CodeEditor=uo;exports.Combobox=st;exports.ConditionEditor=ls;exports.ConfigViewToggle=ps;exports.ConfirmModal=zh;exports.CredentialPicker=ri;exports.DATA_APP=fn;exports.DataTable=Ai;exports.DelegationSteps=vo;exports.DeleteButton=Co;exports.EACH_SOURCE_HANDLE=es;exports.EDITOR_THEME_SPEC=io;exports.ERROR_SOURCE_HANDLE=Qs;exports.EmptyState=Xi;exports.EventbriteTriggerPicker=Qi;exports.ExpressionEditorModal=Sn;exports.ExpressionInput=yn;exports.ExpressionOptionsProvider=nd;exports.FIELD_TYPE_LABELS=br;exports.FOREACH_DONE_ROUTE=et;exports.FORM_APP=mt;exports.HTML_PREVIEW_CSP=Ei;exports.HtmlPreview=Oi;exports.INTERNAL_NODES=wt;exports.IconButton=as;exports.InternalIcon=us;exports.JsonEditor=tt;exports.LastUsedNote=qi;exports.Markdown=Ao;exports.Modal=Re;exports.NodeConfigForm=yi;exports.ParamCustomization=So;exports.ParamsForm=ze;exports.PropertyEntryForm=Ni;exports.PublisherBadge=Ar;exports.RACE_APP=Xt;exports.RACE_DESCRIPTION=vr;exports.RESULT_RENDER_MAX_CHARS=zs;exports.ROUTER_APP=nt;exports.ResultViewer=Ie;exports.RetryPolicyFields=bi;exports.RouterEditor=vi;exports.SCHEDULER_APP=eo;exports.SCRIPT_APP=xr;exports.SecretJsonField=ni;exports.StepBuilderModal=ch;exports.StepFanOutControl=kl;exports.StepNameEditor=ki;exports.StepStateControl=jl;exports.StepTestRun=ta;exports.StopEditor=ji;exports.TEXT_FIELD_TYPES=ql;exports.TRIGGER_APP=Yt;exports.TriggerFillForm=Wi;exports.TriggerSampleButton=Si;exports.W6WUIProvider=Qc;exports.WEBHOOK_APP=Ke;exports.WaitEditor=Ui;exports.WorkflowConnectionPicker=Gi;exports.WorkflowConnectionsContext=Ki;exports.WorkflowProjectProvider=Zc;exports.addTandemCloser=rf;exports.ancestorIds=Ko;exports.applyConnect=cf;exports.applyStepProblems=Pp;exports.asFieldDefs=To;exports.bindingFieldsFor=ii;exports.bridgeDeletedBodyStep=Xp;exports.buildBinding=li;exports.buildResolveScope=po;exports.callableTriggers=Xo;exports.canConnect=il;exports.centralizeConnections=zi;exports.closerDeleteRefusal=sf;exports.closesOpener=tn;exports.coerceDefault=Ro;exports.conditionCombinatorLabel=Yd;exports.conditionOperatorLabel=Gd;exports.connectConflict=uf;exports.connectRefusal=df;exports.connectionAppIdsToLookUp=Qh;exports.connectionExpressionSources=qp;exports.connectionIdFor=en;exports.controlOwnedIds=Mo;exports.convertCodeBindingsToReads=id;exports.customCssTemplate=Vl;exports.dataVarRows=Kn;exports.declaredSamples=Yf;exports.deepEqual=_s;exports.defaultConnectionFor=Vi;exports.defaultFormDefinition=wr;exports.definitionLoops=Uo;exports.deleteStepMessage=nf;exports.detectResultFormat=$i;exports.eachLaneEdge=dt;exports.edgeLane=je;exports.edgeVisuals=kn;exports.edgeWhenConflict=ff;exports.editConnectionResources=Mn;exports.effectiveEdges=Wo;exports.effectiveNodeOutput=Rl;exports.effectiveNodeOutputs=Jh;exports.eventbriteTriggerChoices=Zi;exports.excludeSelfStep=td;exports.fanOutLabel=oh;exports.fanOutState=nh;exports.fieldWidget=Oo;exports.fieldsToParams=Io;exports.filterOptions=Pr;exports.findChainRoot=Tf;exports.findChainTail=Of;exports.findCodeBindings=Qr;exports.findTestInput=Fi;exports.flattenParams=Jt;exports.flowToWorkflow=Cf;exports.foreachTestFixture=Ff;exports.foreachTestSample=Lf;exports.foreachView=Zt;exports.getTriggerDefs=El;exports.hasParamCustomization=cs;exports.htmlPreviewSrcDoc=Ti;exports.idClashMessage=bf;exports.ifPortLayout=fc;exports.indexNodeSamples=Vh;exports.inferOutputFields=$t;exports.insertIntoTandem=lf;exports.internalNodeDef=Pt;exports.internalNodeDefaults=mn;exports.internalNodeIcon=zc;exports.internalNodeLabel=Hc;exports.internalNodeParams=Nr;exports.isConnectionBlocked=Lp;exports.isControlApp=Ht;exports.isDollarPath=fo;exports.isEachLink=Yn;exports.isExprValue=ot;exports.isFloatingDraft=bl;exports.isForeachStep=Fo;exports.isFormResolvedOptions=ns;exports.isIfStep=oo;exports.isInputField=fr;exports.isInternalApp=pt;exports.isLoopCloser=Ge;exports.isLoopOpener=Ne;exports.isParamVisible=Cn;exports.isSecretValue=bt;exports.isTandemOpener=xt;exports.isTestRequired=Nl;exports.isTriggerApp=Hn;exports.isTriggerStep=hc;exports.keyClientId=oi;exports.laneForSourceHandle=Ql;exports.loopBody=Do;exports.loopCloserOf=nn;exports.loopItemText=zf;exports.loopMembership=_e;exports.loopRefusal=al;exports.loopRefusalMessage=ef;exports.newField=Jl;exports.nextWorkflowConnectionName=Po;exports.nodeConfigSources=Qf;exports.nodeConfigValues=Zf;exports.nodeMetaSampleValues=th;exports.nodeMetaValues=eh;exports.nodePortsForStep=hn;exports.normalizeInput=Vo;exports.parseFormDefinition=Kl;exports.parseJsonFields=ti;exports.parseLoopSeed=Vf;exports.parseRootAnchoredTemplate=yt;exports.passLoopSeed=co;exports.pickFormSubscription=Eo;exports.pickWebhookSubscription=_i;exports.previewCustomization=xi;exports.previewNodeOutputs=Kh;exports.relaneRefusal=hf;exports.relayoutNodes=Sf;exports.rememberableInput=$o;exports.renameStepInEdges=mf;exports.requiredParamsFilled=Gt;exports.resolveConnectionAppMeta=Xh;exports.resolveLoopItemsInState=hl;exports.resolveOutputShape=Rt;exports.resolveParamJson=wn;exports.resolveParamValue=mo;exports.resolveVarsJson=Tu;exports.resultCopyText=Pi;exports.routeFromHandle=cc;exports.routeHandle=Qt;exports.routerPortLayout=pc;exports.routesForStep=so;exports.secretClipboard=Bs;exports.seedValues=Vs;exports.selectNodeConnection=Mp;exports.setEdgeWhen=pf;exports.shapeToSkeleton=vn;exports.shouldUseCombobox=$r;exports.slugName=yr;exports.slugifyLabel=Ef;exports.splitFrontmatter=Ci;exports.splitNodeOutputs=Gh;exports.splitPreviewOutputs=Yh;exports.stampLoopOf=tf;exports.startOAuthPopup=ci;exports.startStateFromSeeds=Go;exports.stateWriteVisible=el;exports.stepBuilderLoop=Uf;exports.stepBuilderUpstreamSteps=Wf;exports.stepNameError=ll;exports.stepProblemTooltip=Fp;exports.stepToJson=Jo;exports.storedViewport=ul;exports.strandedClosers=af;exports.stripBody=qo;exports.suggestStepId=dl;exports.testInputSavesSettled=Mi;exports.trackTestInputSave=Li;exports.uniqueName=Xs;exports.upstreamSampleValueSources=Gf;exports.upstreamSampleValues=Kf;exports.upstreamStateSources=qf;exports.useEffectiveTheme=ts;exports.useEnterSubmit=ui;exports.useExpressionOptions=at;exports.useRememberedTestInput=Di;exports.useSeedSources=Yo;exports.useW6WApi=Ee;exports.useWorkflowConnections=_o;exports.valueAtPath=un;exports.varLabel=It;exports.withConnectionRef=xn;exports.withLoopClosers=of;exports.withViewport=Af;exports.workflowToFlow=Nf;
|
|
29
|
-
//# sourceMappingURL=connection-app-meta-
|
|
29
|
+
//# sourceMappingURL=connection-app-meta-CQ85y_6M.cjs.map
|